diff --git a/disasm/disasm.go b/disasm/disasm.go index 66cda640..d2b9488b 100644 --- a/disasm/disasm.go +++ b/disasm/disasm.go @@ -184,7 +184,7 @@ func Disassemble(fn wasm.Function, module *wasm.Module) (*Disassembly, error) { // Same with ops.Br/BrIf, we subtract 2 instead of 1 // to get the depth of the *parent* block of the branch // we want to take. - prevDepthIndex := stackDepths.Len() - 2 + prevDepthIndex := stackDepths.Len() - 1 prevDepth := stackDepths.Get(prevDepthIndex) if op != ops.Else && blockSig != wasm.BlockTypeEmpty && !instr.Unreachable {