From 8fcc534a1972abdf1c9196059fdb724b53b602d8 Mon Sep 17 00:00:00 2001 From: Costa Vitor Date: Fri, 22 May 2009 18:44:05 -0500 Subject: [PATCH] fix bad error propagation in term comparison #53 --- C/absmi.c | 4 +++- C/cmppreds.c | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/C/absmi.c b/C/absmi.c index 6d9d5ea69..10ad3bab4 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -11325,8 +11325,10 @@ Yap_absmi(int inp) d0 = (CELL) (f) (d0,d1); setregs(); } + if (PREG == FAILCODE) { + JMPNext(); + } if (!d0) { - if (PREG != FAILCODE) PREG = PREG->u.plxxs.f; JMPNext(); } diff --git a/C/cmppreds.c b/C/cmppreds.c index b7a233bdc..52b1b1282 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -546,6 +546,7 @@ a_cmp(Term t1, Term t2) return(int_cmp(IntegerOfTerm(t1)-IntegerOfTerm(t2))); } t1 = Yap_Eval(t1); + if (!t1) return FALSE; if (IsIntegerTerm(t1)) { Int i1 = IntegerOfTerm(t1); t2 = Yap_Eval(t2);