From 10f84228bc85af0ec0828aeb129dd43870d88a4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 11 Feb 2011 17:49:19 +0000 Subject: [PATCH] fix handling of cut_c in SWI packages. --- C/c_interface.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index 1949bd290..b01f32877 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -1538,8 +1538,10 @@ YAP_ExecuteFirst(PredEntry *pe, CPredicate exec_code) BallTerm = EX; EX = NULL; if ((t = Yap_GetException())) { - Yap_JumpToEnv(t); - return FALSE; + cut_c_pop(); + B = B->cp_b; + Yap_JumpToEnv(t); + return FALSE; } cut_fail(); } else if (val == 1) { /* TRUE */ @@ -1577,8 +1579,10 @@ YAP_ExecuteNext(PredEntry *pe, CPredicate exec_code) BallTerm = EX; EX = NULL; if ((t = Yap_GetException())) { - Yap_JumpToEnv(t); - return FALSE; + cut_c_pop(); + B = B->cp_b; + Yap_JumpToEnv(t); + return FALSE; } else { cut_fail(); }