Skip to content

Commit 8110e67

Browse files
committed
Ref(tree), which otherwise might get mangled by a GC during %write-history
1 parent e809532 commit 8110e67

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

prim-etc.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,6 @@ static void loginput(char *input) {
169169

170170
PRIM(parse) {
171171
List *result;
172-
Tree *tree;
173172
Ref(char *, prompt1, NULL);
174173
Ref(char *, prompt2, NULL);
175174
Ref(List *, lp, list);
@@ -180,6 +179,8 @@ PRIM(parse) {
180179
}
181180
RefEnd(lp);
182181
newhistbuffer();
182+
183+
Ref(Tree *, tree, NULL);
183184
ExceptionHandler
184185
tree = parse(prompt1, prompt2);
185186
CatchException (e)
@@ -192,7 +193,7 @@ PRIM(parse) {
192193
? NULL
193194
: mklist(mkterm(NULL, mkclosure(mk(nThunk, tree), NULL)),
194195
NULL);
195-
RefEnd2(prompt2, prompt1);
196+
RefEnd3(tree, prompt2, prompt1);
196197
return result;
197198
}
198199

0 commit comments

Comments
 (0)