return copy when copying term
This commit is contained in:
parent
94e740ae31
commit
55e37020a4
@ -1182,11 +1182,11 @@ Yap_SetGlobalVal(Atom at, Term t0)
|
|||||||
ge = GetGlobalEntry(at);
|
ge = GetGlobalEntry(at);
|
||||||
to = CopyTermToArena(t0, GlobalArena, FALSE, 2, &GlobalArena, &GlobalDelayArena, garena_overflow_size(ArenaPt(GlobalArena)));
|
to = CopyTermToArena(t0, GlobalArena, FALSE, 2, &GlobalArena, &GlobalDelayArena, garena_overflow_size(ArenaPt(GlobalArena)));
|
||||||
if (to == 0L)
|
if (to == 0L)
|
||||||
return FALSE;
|
return to;
|
||||||
WRITE_LOCK(ge->GRWLock);
|
WRITE_LOCK(ge->GRWLock);
|
||||||
ge->global=to;
|
ge->global=to;
|
||||||
WRITE_UNLOCK(ge->GRWLock);
|
WRITE_UNLOCK(ge->GRWLock);
|
||||||
return TRUE;
|
return to;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
|
Reference in New Issue
Block a user