summaryrefslogtreecommitdiff
path: root/builtins.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtins.c')
-rw-r--r--builtins.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/builtins.c b/builtins.c
index 43215f8..d1f70b9 100644
--- a/builtins.c
+++ b/builtins.c
@@ -622,13 +622,7 @@ builtincatch(Term *goal, Binding **bindings, Module *module)
catchframe->next = goalstack;
goalstack = catchframe;
- Goal *g = gmalloc(sizeof(Goal));
- g->goal = catchgoal;
- g->module = module;
- g->catcher = nil;
- g->next = goalstack;
- goalstack = g;
-
+ goalstack = addgoals(goalstack, catchgoal, module);
return 1;
}