diff --git a/C/compiler.c b/C/compiler.c index 97ca36c95..9d6999ba9 100644 --- a/C/compiler.c +++ b/C/compiler.c @@ -171,6 +171,7 @@ static char SccsId[] = "%W% %G%"; #include "Yap.h" #include "compile.h" #include "clause.h" +#include "alloc.h" #include "yapio.h" #if HAVE_STRING_H #include @@ -2698,7 +2699,7 @@ checkreg(Int arg, Int rn, compiler_vm_op ic, int var_arg, compiler_struct *cglob static CELL copy_live_temps_bmap(int max, compiler_struct *cglobs) { - unsigned int size = (max|7)/8+1; + unsigned int size = AdjustSize((max|7)/8+1); int i; CELL *dest = Yap_emit_extra_size(mark_live_regs_op, max, size, &cglobs->cint); CELL *ptr=dest; diff --git a/C/heapgc.c b/C/heapgc.c index a6267079b..53b939497 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -1700,7 +1700,8 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B } else if (IsPairTerm(trail_cell)) { /* can safely ignore this */ CELL *cptr = RepPair(trail_cell); - if (IsAttVar(cptr)) { + if (IN_BETWEEN(H0,cptr,H) && + IsAttVar(cptr)) { TrailTerm(trail_base) = (CELL)cptr; mark_external_reference(&TrailTerm(trail_base)); TrailTerm(trail_base) = trail_cell;