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
commit7541ec5f6c4c7c8a2a21b05cd7f4ecc101b8a816 (patch)
tree3bcb287ec79643a0549f45fb621495da247b3e43
parent3987b83f599c83a554a9eede2073991651fba7a2 (diff)
downloadtxr-7541ec5f6c4c7c8a2a21b05cd7f4ecc101b8a816.tar.gz
txr-7541ec5f6c4c7c8a2a21b05cd7f4ecc101b8a816.tar.bz2
txr-7541ec5f6c4c7c8a2a21b05cd7f4ecc101b8a816.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) {