From a4b130ff1b9cb944d6214eeb98e43dae4dfc0922 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 16 Dec 2013 12:34:41 +0000 Subject: [PATCH] do wake up before \! --- C/absmi.c | 24 +++++++++--------------- C/exec.c | 3 +++ 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/C/absmi.c b/C/absmi.c index fd66a983f..20eeac34e 100755 --- a/C/absmi.c +++ b/C/absmi.c @@ -3084,11 +3084,9 @@ Yap_absmi(int inp) /* cut */ Op(cut, s); #ifdef COROUTINING - if (FALSE) { - CACHE_Y_AS_ENV(YREG); - check_stack(NoStackCut, H); - ENDCACHE_Y_AS_ENV(); - } + CACHE_Y_AS_ENV(YREG); + check_stack(NoStackCut, H); + ENDCACHE_Y_AS_ENV(); do_cut: #endif SET_ASP(YREG, PREG->u.s.s); @@ -3110,11 +3108,9 @@ Yap_absmi(int inp) /* cut_t does the same as cut */ Op(cut_t, s); #ifdef COROUTINING - if (FALSE) { - CACHE_Y_AS_ENV(YREG); - check_stack(NoStackCutT, H); - ENDCACHE_Y_AS_ENV(); - } + CACHE_Y_AS_ENV(YREG); + check_stack(NoStackCutT, H); + ENDCACHE_Y_AS_ENV(); do_cut_t: #endif SET_ASP(YREG, PREG->u.s.s); @@ -3135,11 +3131,9 @@ Yap_absmi(int inp) /* cut_e */ Op(cut_e, s); #ifdef COROUTINING - if (FALSE) { - CACHE_Y_AS_ENV(YREG); - check_stack(NoStackCutE, H); - ENDCACHE_Y_AS_ENV(); - } + CACHE_Y_AS_ENV(YREG); + check_stack(NoStackCutE, H); + ENDCACHE_Y_AS_ENV(); do_cut_e: #endif SET_ASP(YREG, PREG->u.s.s); diff --git a/C/exec.c b/C/exec.c index e090d6d9d..5cad301eb 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1815,6 +1815,9 @@ Yap_InitYaamRegs( int myworker_id ) DepFr_cons_cp(REMOTE_top_dep_fr(myworker_id)) = NORM_CP(B); #endif UNLOCK(REMOTE_SignalLock(myworker_id)); + // make sure we have slots in case we don go through the top-level */ + Yap_StartSlots( PASS_REGS1 ); + } static Int