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

@@ -56,6 +56,7 @@ impl MemoryStyle {
if maximum <= tunables.static_memory_bound {
// A heap with a declared maximum can be immovable, so make
// it static.
assert!(tunables.static_memory_bound >= memory.minimum);
return (
MemoryStyle::Static {
bound: tunables.static_memory_bound,