nosuchtim / keykit

KeyKit - an algorithmic MIDI scripting language and GUI system
Other
99 stars 7 forks source link

Prevent duplicate source file close on syntax error #3080

Closed pbarada closed 1 year ago

pbarada commented 1 year ago

If a syntax error occurs while parsing a loaded symbol file, the souce file is closed twice, once by popfin(called from yyerror) and the other by an explicit myfclose in loadsymfile(). Since a parse error can cause multiple yyerror invocations, prevent popfin from both freeing Infile and closing Fin multiple times by setting Fin to NULL after its closed. At same time check if yyparse failed and skip the explicit close call.