From dba3444a049238e31c93bc957c95c2c1f3bd2db8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 18 Apr 2009 18:49:12 -0500 Subject: [PATCH] fix stack for construction of deep terms in PL_unify. --- library/yap2swi/yap2swi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/library/yap2swi/yap2swi.c b/library/yap2swi/yap2swi.c index 3aa2536fe..69209f39a 100644 --- a/library/yap2swi/yap2swi.c +++ b/library/yap2swi/yap2swi.c @@ -1243,8 +1243,8 @@ X_API int PL_unify_term(term_t l,...) fprintf(stderr,"ERROR: very deep term in PL_unify_term, change MAX_DEPTH from %d\n", MAX_DEPTH); return FALSE; } - stack[depth].nels = nels; - stack[depth].ptr = pt+1; + stack[depth-1].nels = nels; + stack[depth-1].ptr = pt+1; depth++; } *pt = t; @@ -1272,8 +1272,8 @@ X_API int PL_unify_term(term_t l,...) fprintf(stderr,"very deep term in PL_unify_term\n"); return FALSE; } - stack[depth].nels = nels; - stack[depth].ptr = pt+1; + stack[depth-1].nels = nels; + stack[depth-1].ptr = pt+1; depth++; } *pt = t; @@ -1294,7 +1294,7 @@ X_API int PL_unify_term(term_t l,...) fprintf(stderr,"very deep term in PL_unify_term\n"); return FALSE; } - stack[depth].nels = nels; + stack[depth-1].nels = nels; stack[depth].ptr = pt+1; depth++; }