X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=tests%2Flanguage%2Flexer%2Flexer.at;h=7519ffc2fa489f17df5247d4c2ca68512e5f8699;hb=8037ba709328b0896cf825f0ca6e4177ee4a512b;hp=5b6b660ecdc9c91cb3be65108c57f5ef0ac05d72;hpb=47b016a3e38e43d446724f784fd4782456e676b2;p=pspp diff --git a/tests/language/lexer/lexer.at b/tests/language/lexer/lexer.at index 5b6b660ecd..7519ffc2fa 100644 --- a/tests/language/lexer/lexer.at +++ b/tests/language/lexer/lexer.at @@ -133,3 +133,19 @@ AT_CHECK([pspp -O format=csv lexer.sps], [1], [dnl ]) AT_CLEANUP + +AT_SETUP([lexer crash due to reentrancy in error processing]) +dnl ^ is an invalid character in input that triggers an error message. +dnl 100 of them, as shown below, exceeds the 100-error limit. The +dnl minus sign causes the lexer to look ahead for a number, and then +dnl the ^ encountered afterward causes an error too, and then the +dnl message emission handler might reenter the lexer looking for a +dnl location, which can then cause the lexer to try to get a token +dnl again. It's a whole mess and the new way of avoiding reentrancy +dnl by keeping a collection of messages to emit until we've almost +dnl returned to the top level is much less prone to error. +AT_DATA([lexer.sps], [dnl +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-^ +]) +AT_CHECK([pspp lexer.sps], [1], [ignore]) +AT_CLEANUP \ No newline at end of file