Skip to content

Commit 1e1104a

Browse files
mjp41nwf
authored andcommitted
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.
1 parent a0377f6 commit 1e1104a

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/mem/sizeclasstable.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,8 @@ namespace snmalloc
357357
}
358358
else
359359
{
360+
if (size == 0)
361+
return 0;
360362
return slab_start + (offset / size) * size;
361363
}
362364
}

0 commit comments

Comments
 (0)