Fix parser infinite loop on implicit program followed by explicit unit
parse_implicit_program returned without consuming the END PROGRAM
tokens. parse_file re-entered parse_program_unit at the same
position, creating an infinite loop on inputs like:
type :: t / end type / program p / end program
Root cause: parse_unit_body breaks BEFORE the terminator tokens,
leaving them unconsumed. parse_program calls consume_end after
parse_unit_body, but parse_implicit_program did not.
Found by fuzz smoke test with randomized Fortran fragments.
tokens. parse_file re-entered parse_program_unit at the same
position, creating an infinite loop on inputs like:
type :: t / end type / program p / end program
Root cause: parse_unit_body breaks BEFORE the terminator tokens,
leaving them unconsumed. parse_program calls consume_end after
parse_unit_body, but parse_implicit_program did not.
Found by fuzz smoke test with randomized Fortran fragments.
Authored by
mfwolffe <wolffemf@dukes.jmu.edu>
- SHA
d9bb467d87ed84683013b141f1d6ab6043fa73ef- Parents
-
08b0346 - Tree
dc73bab