AddressSanitizer:DEADLYSIGNAL ================================================================= ==21==ERROR: AddressSanitizer: SEGV on unknown address (pc 0x00000034cf4a bp 0x7ffcd7ae0c50 sp 0x7ffcd7ae0b20 T0) ==21==The signal is caused by a READ memory access. ==21==Hint: this fault was caused by a dereference of a high value address (see register values below). Dissassemble the provided pc to learn which register was used. #3 0x7efc32c4c082 (/lib/x86_64-linux-gnu/libc.so.6+0x24082) AddressSanitizer can not provide additional info. ==21==ABORTING
qian栈
qian.top()之前需要对qian进行判空。
if(!qian.empty()&&qian.top()=='(')