Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ATN-failover with erroneous input can corrupt cached DFA #15

Closed
sharwell opened this issue Feb 15, 2012 · 1 comment
Closed

ATN-failover with erroneous input can corrupt cached DFA #15

sharwell opened this issue Feb 15, 2012 · 1 comment

Comments

@sharwell
Copy link
Member

When execDFA fails to find a cached edge for an input, it falls back to execATN. The fallback is enclosed in a try/catch block, and if execATN throws a RecognitionException an ERROR edge is added to the cached DFA. When the erroneous symbol that resulted in execATN throwing an exception is not the first symbol checked by execATN, the update to the cached DFA blocks the entire input sequence leading to the erroneous symbol starting with the first uncached (yet possibly valid) symbol. This is fixed in sharwell/antlr4@cd3adb1, and included in pull request parrt#15.

@sharwell
Copy link
Member Author

I don't have a unit test for this issue currently. It arose periodically when I was doing permutation testing on the input by injecting thousands of different errors at different locations.

parrt added a commit to parrt/antlr4 that referenced this issue Feb 20, 2012
parrt pushed a commit that referenced this issue Jun 30, 2015
parrt pushed a commit that referenced this issue Nov 7, 2016
KvanTTT pushed a commit to KvanTTT/antlr4 that referenced this issue Jan 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant