From 77c7fea4cee74562ad60c7ce96ca830a7ebda8b7 Mon Sep 17 00:00:00 2001 From: Peter Mikkelsen Date: Thu, 22 Jul 2021 19:18:33 +0000 Subject: Use addgoals to add the goal in catch/3 to the goalstack, allowing mod:pred goals too --- builtins.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'builtins.c') 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; } -- cgit v1.2.3