Fix 32bit external pointer.

For 32bit external pointer it was performing a divide by size, and for
things not managed by snmalloc this was causing a crash.  This checks
for zero, and gives the start of the address range as the start of the
object.
This commit is contained in:
Matthew Parkinson
2022-03-17 09:47:01 +00:00
committed by Nathaniel Wesley Filardo
parent a0377f62eb
commit 1e1104a11c

View File

@@ -357,6 +357,8 @@ namespace snmalloc
}
else
{
if (size == 0)
return 0;
return slab_start + (offset / size) * size;
}
}