summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2024-06-30 18:02:30 -0700
committerKaz Kylheku <kaz@kylheku.com>2024-06-30 18:02:30 -0700
commitbc567f6564802c561c3e80b6c22efffdb7f7a99f (patch)
tree3bcb287ec79643a0549f45fb621495da247b3e43
parent15dc034898cf7cc35579146d718875e2881d709b (diff)
downloadtxr-bc567f6564802c561c3e80b6c22efffdb7f7a99f.tar.gz
txr-bc567f6564802c561c3e80b6c22efffdb7f7a99f.tar.bz2
txr-bc567f6564802c561c3e80b6c22efffdb7f7a99f.zip
txr: @(data) must disable recycling.
* match.c (v_data): Set c->top to zero; after capturing the c->data pointer to a variable, we must no longer forcibly recycle the head of the data as we march down.
-rw-r--r--match.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/match.c b/match.c
index 451fac24..24e3eb43 100644
--- a/match.c
+++ b/match.c
@@ -4837,6 +4837,7 @@ static val v_data(match_files_ctx *c)
if (!args || rest(args))
sem_error(specline, lit("data directive takes one argument"), nao);
+ c->top = 0;
c->bindings = dest_bind(specline, c->bindings, pat, c->data, eql_f);
if (c->bindings == t) {