You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Batch scanners swallow a NUL byte into the previous token (since 2.6.5) #885
In a batch scanner with compressed tables, when the input contains a NUL byte that cannot extend the current match, the NUL is swallowed into the previous token.
flex 2.6.4 is correct. 2.6.5, 2.6.15 and current master (v2.7.2-1-gaa34df3) are wrong. Interactive scanners and full tables are not affected. The default, C++ and c99 back ends are all affected.
We hit it with a scanner for a binary format, where a one-byte token is often followed by a NUL byte.
2.6.5 and later generate only goto yy_find_action;, leaving yy_cp one byte past the NUL.
In the skeletons (src/cpp-flex.skl, src/c99-flex.skl and src/go-flex.skl), that back-up has been guarded by m4_ifdef([[M4_NOT_MODE_INTERACTIVE]], ...) since e7b3a67. Nothing defines M4_NOT_MODE_INTERACTIVE; src/main.c defines M4_MODE_NO_INTERACTIVE instead.
Activity
lexer: build a working scanner with flex 2.6.16 and later
fix(skel): back up after an unmatched NUL in batch scanners
lexer: build a working scanner with flex 2.6.16 and later (#1473)