more valgrind catches.

This commit is contained in:
Vítor Santos Costa II 2010-04-08 00:53:38 +01:00
parent 222aac067b
commit 3fd7da94ba
2 changed files with 4 additions and 2 deletions

View File

@ -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 <string.h>
@ -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;

View File

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