aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 16:39:17 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 16:39:17 +0330
commitd7cbb2cdc3436f2407365c57f31f29631441bab4 (patch)
treea3b9d26c23ac7643c1587ca55469aa4f24f71fe8
parentzc0: u*x, m*x, d*x are products when u, m or d is a visible local or global (... (diff)
zc0: free the saved token when the local-embed lookahead returns early
-rw-r--r--src/tools/zc0.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/zc0.c b/src/tools/zc0.c
index a3c3f4a..d484016 100644
--- a/src/tools/zc0.c
+++ b/src/tools/zc0.c
@@ -783,7 +783,7 @@ static void stmt(void)
else if (is(".")) { next(); ptagname(); nw = 1; } /* a bare tag: .m p = new(3); */
else if (is("embed")) { /* embed "file" as [type] name; makes a local */
Lex L; lexsave(&L); next();
- if (tk == T_STR) { embeddecl(1); return; }
+ if (tk == T_STR) { free(L.ts); embeddecl(1); return; } /* the saved token is not restored */
lexrest(&L);
}
if (nw >= 0 || accept("let") || accept("var")) {