packcc
packcc copied to clipboard
Null pointer error on broken grammar
Hello @arithy,
I have noticed very small bug that might crash PackCC, but only on some very broken grammars.
If there is only one rule and it contains syntax error, then null
pointer is dereferenced at packcc.c:3148.
Grammar to test:
main <- ( "A"
If the grammar contains two or more rules, than it fails correctly (returns non-zero code, but doesn't crash).
I am aware that this is pretty far fetched corner case (I have only found it due to another bug in my application :slightly_smiling_face:) and it's up to you if you want to fix it or not. I just wanted to let you know.
Hello @dolik-rce , thank you for the helpful report. It's caused by a careless mistake... I'll fix it.
I have tested with the new code, issue is solved. Thank you.