zeek / spicy

C++ parser generator for dissecting protocols & files.
https://docs.zeek.org/projects/spicy
Other
243 stars 37 forks source link

Fix synchronization with symbol different from last lookahead token. #1776

Closed bbannier closed 1 month ago

bbannier commented 1 month ago

If synchronize-[at|after] used a lookahead symbol different from the last lookahead symbol (e.g., normal parsing used a literal, recovery a regexp), synchronization would clobber the lookahead symbol so that after successful synchronization normal parsing could still not succeed.

This patch sets up dedicated parser state for synchronization to prevent the clobbering.

Closes #1774.