fix fix to ground

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1276 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2005-04-15 20:26:45 +00:00
parent 253af23552
commit 697604bbae
2 changed files with 13 additions and 3 deletions

View File

@ -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;
}

View File

@ -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;