diff --git a/C/absmi.c b/C/absmi.c index 110501c10..8b9fc19c2 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -1777,7 +1777,6 @@ absmi(int inp) NoStackCall: /* on X86 machines S will not actually be holding the pointer to pred */ SREG = (CELL *) PREG->u.sla.p; - NoStackCallGotS: #ifdef YAPOR /* abort_optyap("NoStackCall in function absmi"); */ if (HeapTop > GlobalBase - MinHeapGap) @@ -11168,7 +11167,7 @@ absmi(int inp) CACHE_Y_AS_ENV(Y); #ifndef NO_CHECKING - check_stack(NoStackPExec, H); + check_stack(NoStackCall, H); #endif BEGD(d0); d0 = ARG1; @@ -11274,11 +11273,6 @@ absmi(int inp) ENDD(d0); ENDCACHE_Y_AS_ENV(); - NoStackPExec: - /* on X86 machines S will not actually be holding the pointer to pred */ - SREG = (CELL *) pen; - goto NoStackCallGotS; - } ENDBOp(); @@ -11291,7 +11285,7 @@ absmi(int inp) CACHE_Y_AS_ENV(Y); #ifndef NO_CHECKING - check_stack(NoStackPWExec, H); + check_stack(NoStackCall, H); #endif BEGD(d0); d0 = ARG1; @@ -11423,12 +11417,6 @@ absmi(int inp) ENDP(pt1); ENDD(d0); ENDCACHE_Y_AS_ENV(); - - NoStackPWExec: - /* on X86 machines S will not actually be holding the pointer to pred */ - SREG = (CELL *) pen; - goto NoStackCallGotS; - } ENDBOp(); @@ -11439,7 +11427,7 @@ absmi(int inp) CACHE_Y_AS_ENV(Y); #ifndef NO_CHECKING - check_stack(NoStackPWLExec, H); + check_stack(NoStackCall, H); #endif BEGD(d0); d0 = ARG1; @@ -11522,6 +11510,16 @@ absmi(int inp) else d0 = (CELL)B; PREG = (yamop *) pen->CodeOfPred; +#ifdef DEPTH_LIMIT + if (DEPTH <= MkIntTerm(1)) {/* I assume Module==0 is primitives */ + if (pen->ModuleOfPred) { + if (DEPTH == MkIntTerm(0)) + FAIL(); + else DEPTH = RESET_DEPTH(); + } + } else if (pen->ModuleOfPred) + DEPTH -= MkIntConstant(2); +#endif /* DEPTH_LIMIT */ /* do deallocate */ CPREG = (yamop *) E_Y[E_CP]; E_Y = ENV = (CELL *) E_Y[E_E]; @@ -11559,11 +11557,6 @@ absmi(int inp) ENDD(d0); ENDCACHE_Y_AS_ENV(); - NoStackPWLExec: - /* on X86 machines S will not actually be holding the pointer to pred */ - SREG = (CELL *) pen; - goto NoStackCallGotS; - } ENDBOp(); diff --git a/C/tracer.c b/C/tracer.c index b9b74799a..f88d05344 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -122,10 +122,7 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) /* if (vsc_count > 500000) exit(0); */ /* if (gc_calls < 1) return;*/ #if defined(__GNUC__) - { - choiceptr myB=B; - YP_fprintf(YP_stderr,"%llu (%p, %p, %p) ", vsc_count, TR, ENV, myB); - } + YP_fprintf(YP_stderr,"%llu (%d) ", vsc_count, IntegerOfTerm(DEPTH)); #endif /* check_trail_consistency(); */ if (pred == NULL) {