From 88e188bece79ff06d11df2e635b18da9dd8fa1c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Wed, 11 Dec 2013 09:04:59 +0000 Subject: [PATCH] fix excessive trail trimming in SWI call emulation --- library/dialect/swi/fli/swi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 0ff820926..725afbe88 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -2108,6 +2108,9 @@ PL_close_foreign_frame(fid_t f) CACHE_REGS choiceptr cp_b = (choiceptr)(LCL0-(UInt)f); LOCAL_CurSlot = IntOfTerm(cp_b->cp_a1); + B = cp_b; + HB = B->cp_h; + Yap_TrimTrail(); B = cp_b->cp_b; CP = cp_b->cp_cp; ENV = cp_b->cp_env; @@ -2115,7 +2118,6 @@ PL_close_foreign_frame(fid_t f) DEPTH = cp_b->cp_depth; #endif /* DEPTH_LIMIT */ HB = B->cp_h; - Yap_TrimTrail(); if (LOCAL_CurSlot) { /* we can assume there was a slot before */ CELL *old_slot;