From a1f55d9866537d7374f51a4c687c34c5ca632b19 Mon Sep 17 00:00:00 2001 From: Daniel Stelzer Date: Sat, 29 Aug 2026 13:37:58 -0500 Subject: [PATCH 1/2] prevent hidden variables from interfering with closures --- src/parse.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/parse.c b/src/parse.c index 55ee3cf8..cc2a86ac 100644 --- a/src/parse.c +++ b/src/parse.c @@ -1366,6 +1366,9 @@ static struct astnode *parse_expr(int parsemode, struct lexer *lexer, struct are for(i = 0; i < cl->nvar; i++) { if(!strcmp(cl->varnames[i]->name, "_")) { have_arg = 1; + } else if(cl->varnames[i]->name[0] == '*') { + // Internal variables (created via fresh_word) cannot be accessed outside the closure, so they should not be considered parameters + // We don't want them to interfere with the optimizer's analysis of whether parameters to ( invoke-closure $ $ $) are bound } else { sub = an->children[1]; an->children[1] = mkast(AN_PAIR, 2, cl->arena, orig_line); From 73401b251c31a945a36cb248c69ab97bd0674508 Mon Sep 17 00:00:00 2001 From: Daniel Stelzer Date: Sat, 29 Aug 2026 13:44:10 -0500 Subject: [PATCH 2/2] readme --- readme.txt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/readme.txt b/readme.txt index 3e9c5f76..bb434bfb 100644 --- a/readme.txt +++ b/readme.txt @@ -49,9 +49,12 @@ Release notes: The problem isn't really fixed, but it will no longer corrupt your game text. - Unit test runner: (game over) and (game over $) are - now overridden in unit.dg, to enable testing of win - conditions. + Compiler: re-fixed the obscure bug with divs and spans inside + closures, which was previously only fixed for the debugger, not + for the compiler. Oops! + + Unit test runner: (game over) and (game over $) are now + overridden in unit.dg, to enable testing of win conditions. Documentation: even more has been added to chapter 12.