From dda96dc613c98c9d473a0250ebdcd4fae5372884 Mon Sep 17 00:00:00 2001 From: ricroc Date: Mon, 1 Aug 2005 18:26:28 +0000 Subject: [PATCH] TABLING FIXED: opcode test in instruction table_try_answer git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1353 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- OPTYap/tab.insts.i | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/OPTYap/tab.insts.i b/OPTYap/tab.insts.i index 2f05fec00..4b2b21e75 100644 --- a/OPTYap/tab.insts.i +++ b/OPTYap/tab.insts.i @@ -5,7 +5,7 @@ Copyright: R. Rocha and NCC - University of Porto, Portugal File: tab.insts.i - version: $Id: tab.insts.i,v 1.17 2005-08-01 15:40:38 ricroc Exp $ + version: $Id: tab.insts.i,v 1.18 2005-08-01 18:26:28 ricroc Exp $ **********************************************************************/ @@ -328,20 +328,19 @@ GONext(); } else { yamop *code_ap; - OPCODE code = Yap_opcode(_table_try_me); PREG = SgFr_code(sg_fr); - if (PREG->opc > code) { + if (PREG->opc == Yap_opcode(_table_try)) { /* table_try */ code_ap = NEXTOP(PREG,ld); PREG = PREG->u.ld.d; - } else if (PREG->opc == code) { - /* table_try_me */ - code_ap = PREG->u.ld.d; - PREG = NEXTOP(PREG,ld); - } else { + } else if (PREG->opc == Yap_opcode(_table_try_single)) { /* table_try_single */ code_ap = COMPLETION; PREG = PREG->u.ld.d; + } else { + /* table_try_me */ + code_ap = PREG->u.ld.d; + PREG = NEXTOP(PREG,ld); } restore_generator_node(SgFr_arity(sg_fr), code_ap); YENV = (CELL *) PROTECT_FROZEN_B(B);