aboutsummaryrefslogtreecommitdiffstats
path: root/awkgram.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2022-04-11 21:08:06 -0700
committerKaz Kylheku <kaz@kylheku.com>2022-04-11 21:08:06 -0700
commit97294a20f0121b5edd0e709375a5c18d013d258e (patch)
tree6b27697bf15fb4a3e2a136d7ac667118658c3037 /awkgram.c
parent5a0d83f4b42b9ca28cc6b8dd190a570c47b203c8 (diff)
downloadegawk-97294a20f0121b5edd0e709375a5c18d013d258e.tar.gz
egawk-97294a20f0121b5edd0e709375a5c18d013d258e.tar.bz2
egawk-97294a20f0121b5edd0e709375a5c18d013d258e.zip
@let: bugfix: two free lists are needed.
When functions containing let are compiled, they leave nodes on the let_free list. These nodes are of the wrong type for re-use by the compilation of an external @let. That causes a crash. Secondly, when we compile a function, we free the let_free list. This is also bad, because if it contains nodes allocated by the compilation of external lets, we would like those to be re-used for subsequent external lets after that function, and not to allocate new variables. * awkgram.y (let_gfree): New static variable. (statement): In the aftermath of the @let statement, when returning the variable nodes to the free list, we now choose which of the two free lists to return to based on whether we are inside a function. (add_let): Try to allocate from let_free if a function is being compiled, otherwise from let_gfree.
Diffstat (limited to 'awkgram.c')
0 files changed, 0 insertions, 0 deletions