From 697604bbae53c22d4391cceea98220291d7dbb9d Mon Sep 17 00:00:00 2001 From: vsc Date: Fri, 15 Apr 2005 20:26:45 +0000 Subject: [PATCH] fix fix to ground git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1276 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/utilpreds.c | 11 ++++++++++- LGPL/JPL/src/jpl.c | 5 +++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/C/utilpreds.c b/C/utilpreds.c index 517e6b733..6016cfed7 100644 --- a/C/utilpreds.c +++ b/C/utilpreds.c @@ -1088,7 +1088,7 @@ static Int ground_complex_term(register CELL *pt0, register CELL *pt0_end) *pt0 = (CELL)to_visit[2]; } #endif - return(FALSE); + return FALSE; } /* Do we still have compound terms to visit */ if (to_visit > to_visit0) { @@ -1107,6 +1107,15 @@ static Int ground_complex_term(register CELL *pt0, register CELL *pt0_end) return TRUE; aux_overflow: + /* unwind stack */ +#ifdef RATIONAL_TREES + while (to_visit > to_visit0) { + to_visit -= 3; + pt0 = to_visit[0]; + pt0_end = to_visit[1]; + *pt0 = (CELL)to_visit[2]; + } +#endif return -1; } diff --git a/LGPL/JPL/src/jpl.c b/LGPL/JPL/src/jpl.c index 4f9955e08..f44eaee2a 100644 --- a/LGPL/JPL/src/jpl.c +++ b/LGPL/JPL/src/jpl.c @@ -1,4 +1,4 @@ -/* $Id: jpl.c,v 1.4 2005-04-10 04:01:13 vsc Exp $ +/* $Id: jpl.c,v 1.5 2005-04-15 20:26:45 vsc Exp $ Part of JPL -- SWI-Prolog/Java interface @@ -2171,7 +2171,7 @@ jni_void_2_plc( /* -%T jni_SetByteArrayElement(+term, +term, +term) + %T jni_SetByteArrayElement(+term, +term, +term) */ static foreign_t jni_SetByteArrayElement( @@ -2193,6 +2193,7 @@ jni_SetByteArrayElement( JNI_term_to_byte_jarray(env,ta1,&p1) && JNI_term_to_jint(ta2,&i2) && JNI_term_to_jbyte(ta3,&i3) + && fprintf(stderr,"%p, %d, %d\n", p1,i2,i3) && ( (*env)->SetByteArrayRegion(env,p1,i2,1,&i3) , TRUE ); return jni_check_exception() && r;