Inline jump tables in parsed br_table instructions (#5755)
As jump tables are used by at most one br_table instruction, inline their definition in those instructions instead of requiring them to be declared as function-level metadata.
This commit is contained in:
@@ -1,19 +1,15 @@
|
||||
test verifier
|
||||
|
||||
function %br_invalid_default(i32) {
|
||||
jt0 = jump_table [block1, block1]
|
||||
|
||||
block0(v0: i32):
|
||||
br_table v0, block2, jt0 ; error: invalid block reference block2
|
||||
br_table v0, block2, [block1, block1] ; error: invalid block reference block2
|
||||
block1:
|
||||
return
|
||||
}
|
||||
|
||||
function %br(i32) {
|
||||
jt0 = jump_table [block1, block2] ; error: invalid block reference block2
|
||||
|
||||
block0(v0: i32):
|
||||
br_table v0, block1, jt0
|
||||
br_table v0, block1, [block1, block3] ; error: invalid block reference block3
|
||||
block1:
|
||||
return
|
||||
}
|
||||
|
||||
@@ -66,10 +66,9 @@ function %fn_call_incorrect_arg_type(i64) {
|
||||
; TODO: Should we instead just verify that jump tables contain no blocks that take arguments? This
|
||||
; error doesn't occur if no instruction uses the jump table.
|
||||
function %jump_table_args() {
|
||||
jt1 = jump_table [block1]
|
||||
block0:
|
||||
v0 = iconst.i32 0
|
||||
br_table v0, block2, jt1 ; error: takes no arguments, but had target block1 with 1 arguments
|
||||
br_table v0, block2, [block1] ; error: takes no arguments, but had target block1 with 1 arguments
|
||||
|
||||
block1(v5: i32):
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user