Correct base calculation in anyref allocator

This `base` value is the raw value coming out of the first call to
`table.grow`. Throwing in the addition of `JSIDX_RESERVED` just wasn't
right!
This commit is contained in:
Alex Crichton 2019-08-01 12:00:33 -07:00
parent 6cc7e3dadf
commit adde6c2da7

View File

@ -39,7 +39,7 @@ impl Slab {
internal_error("table grow failure")
}
if self.base == 0 {
self.base = r as usize + (super::JSIDX_RESERVED as usize);
self.base = r as usize;
} else if self.base + self.data.len() != r as usize {
internal_error("someone else allocated table entires?")
}