mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-03-05 03:50:41 -08:00
Do not try to deallocate pointers outside our heap.
This commit is contained in:
parent
1e9e0c140c
commit
04c7cce1d4
1 changed files with 11 additions and 10 deletions
21
src/c/gbc.d
21
src/c/gbc.d
|
|
@ -886,16 +886,17 @@ ecl_gc(cl_type t)
|
|||
static void
|
||||
_mark_contblock(void *x, cl_index s)
|
||||
{
|
||||
register cl_ptr p = x, q;
|
||||
register ptrdiff_t pg = page(p);
|
||||
|
||||
if (pg < 0 || (cl_type)type_map[pg] != t_contiguous)
|
||||
return;
|
||||
q = p + s;
|
||||
p = int2ptr(ptr2int(p) & ~3);
|
||||
q = int2ptr(ptr2int(q + 3) & ~3);
|
||||
for (; p < q; p+= 4)
|
||||
set_mark_bit(p);
|
||||
cl_ptr p = x, q;
|
||||
if (p >= heap_start && p < data_end) {
|
||||
ptrdiff_t pg = page(p);
|
||||
if ((cl_type)type_map[pg] == t_contiguous) {
|
||||
cl_ptr q = p + s;
|
||||
p = int2ptr(ptr2int(p) & ~3);
|
||||
q = int2ptr(ptr2int(q + 3) & ~3);
|
||||
for (; p < q; p+= 4)
|
||||
set_mark_bit(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue