keep on working even after an overflow.

This commit is contained in:
Vítor Santos Costa II 2010-04-09 18:08:08 +01:00
parent d524dd542d
commit 469fab876d
1 changed files with 4 additions and 1 deletions

View File

@ -1785,9 +1785,12 @@ p_nb_heap_add_to_heap(void)
if (arena == 0L)
return FALSE;
mingrow = garena_overflow_size(ArenaPt(arena));
key = CopyTermToArena(ARG2, arena, FALSE, TRUE, 3, qd+HEAP_ARENA, mingrow);
ARG2 = CopyTermToArena(ARG2, arena, FALSE, TRUE, 3, qd+HEAP_ARENA, mingrow);
qd = GetHeap(ARG1,"add_to_heap");
arena = qd[HEAP_ARENA];
to = CopyTermToArena(ARG3, arena, FALSE, TRUE, 3, qd+HEAP_ARENA, mingrow);
/* protect key in ARG2 in case there is an overflow while copying to */
key = ARG2;
if (key == 0 || to == 0L)
return FALSE;
qd = GetHeap(ARG1,"add_to_heap");