Avoid creating slices with null pointers.

This commit is contained in:
Dan Gohman
2019-01-03 12:04:19 -08:00
parent 57e183f5f8
commit 701b1998e9
4 changed files with 8 additions and 5 deletions

View File

@@ -121,7 +121,6 @@ impl LinearMemory {
if new_bytes > self.mmap.len() - self.offset_guard_size {
// If we have no maximum, this is a "dynamic" heap, and it's allowed to move.
assert!(self.maximum.is_none());
let guard_bytes = self.offset_guard_size;
let request_bytes = new_bytes.checked_add(guard_bytes)?;