From 493b591b669567fa269a6de2ea65585842411f4d Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 18 Dec 2013 19:34:15 +0000 Subject: [PATCH] slots again: make sure they're bound after resetting the stack and when calling InitForeign --- C/c_interface.c | 3 +++ C/load_foreign.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/C/c_interface.c b/C/c_interface.c index 4503d8dd0..dabd21bd8 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -3394,6 +3394,9 @@ YAP_Reset(void) /* the first real choice-point will also have AP=FAIL */ /* always have an empty slots for people to use */ P = CP = YESCODE; + // ensure that we have slots where we need them + LOCAL_CurSlot = 0; + Yap_StartSlots( PASS_REGS1 ); RECOVER_MACHINE_REGS(); return res; } diff --git a/C/load_foreign.c b/C/load_foreign.c index 937c89f26..5a5f07b5f 100755 --- a/C/load_foreign.c +++ b/C/load_foreign.c @@ -83,7 +83,9 @@ p_load_foreign( USES_REGS1 ) /* call the OS specific function for dynamic loading */ if(Yap_LoadForeign(ofiles,libs,InitProcName,&InitProc)==LOAD_SUCCEEDED) { + Int CurSlot = Yap_StartSlots( PASS_REGS1 ); (*InitProc)(); + LOCAL_CurSlot = CurSlot; returncode = TRUE; }