Closed carltraveler closed 5 years ago
same issue with else opcode. I think if end or else code need discard element. will cause panic.
I was under the impression that blocks must finish with the same stack height as their parent to be valid (after accounting for any return type), is this correct?
If so, it should be sufficient to improve wagon's validation to detect this?
Can you test is #161 addresses this bug?
161 is merged, so can you retest with the latest (v0.6.0) ?
Closing as I think this is addressed in v0.6.0, and the issue with else/if on refs/master/head.
like bolow code:
(module (type (;0;) (func (result i32))) (func (;0;) (type 0) (result i32) (local i32 i32) block i32.const 1 if i32.const 10 i32.const 2 i32.const 2 i32.const 0 br_if 1 end end i32.const 9 ) (export "loop" (func 0)))
the 'end' opcode can restore height. this is not coherence with spec. and this code can not pass by wasm-validate. however can run ok with wagon