Fix a panic in table-ops translation (#2350)

This fixes an issue where `ensure_inserted_block()` wasn't called before
we do some block manipulation in the Wasmtime translation of some
table-related instructions. It looks like `ensure_inserted_block()` is
otherwise called on most instructions being added, so we just need to
call it explicitly it seems here.

Closes #2347
This commit is contained in:
Alex Crichton
2020-11-02 17:53:43 -06:00
committed by GitHub
parent 6d50099816
commit 372ae2aeb6
2 changed files with 28 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
(module
(func $test (param i32) (result externref)
i32.const 0
if
else
end
local.get 0
table.get 0
)
(table 4 externref)
(export "test" (func $test))
)
(module
(func $test (param i32)
i32.const 0
if
else
end
local.get 0
ref.null extern
table.set 0
)
(table 4 externref)
(export "test" (func $test))
)