Don't require that the fallthrough instruction has an encoding.
A fallthrough jump is actually represented as 0 bytes, so no encoding is needed. Also allow for unencoded instructions in the generated emit_inst implementations. The verifier has stricter rules for when this is allowed.
This commit is contained in:
@@ -32,3 +32,14 @@ ebb1(v2: i32):
|
||||
ebb2:
|
||||
jump ebb1(v0)
|
||||
}
|
||||
|
||||
function %br_if_fallthrough(i32) -> i32 {
|
||||
ebb0(v0: i32):
|
||||
v1 = iconst.i32 1
|
||||
brz v0, ebb1(v1)
|
||||
; This jump gets converted to a fallthrough.
|
||||
jump ebb1(v0)
|
||||
|
||||
ebb1(v2: i32):
|
||||
return v2
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user