Fieldbooks / WebAssembly / Lesson 07
Lesson 07 of 08 · Course index 00 Start Here: What & WhyStack & control 01 Jump or trap?02 Stack types03 Branch targets04 Unreachable codeMemory & calls 05 Page bounds06 Indirect callsVerification 07 Two verifier designs→ 08 Transfer exam Lesson 07 / Verification
Two paths, one result Check both paths through an if. The test value is 1, so a run would choose the first path. The if promises one i32 where the paths meet. A control-flow graph, or CFG, is a drawing of where execution can go. Each arrow carries the types a path leaves on the stack. Trace both paths to decide whether the program can run.
+ Figure 07
Two arrows into the same join
i
1 · The big idea Why is WebAssembly verification fast enough to run on every browser page load? Because WebAssembly’s structured control flow (block, loop, if/else/end) lets a browser verify an entire module in a single linear pass —reading each byte once and throwing it away!
Traditional compilers (and Java’s JVM verifier) often use a two-pass control-flow graph (CFG) : Pass 1 maps every branch arrow between basic blocks; Pass 2 propagates type stacks along every arrow and checks that paths meeting at a join point agree on the exact same types.
Crucially, both designs check every possible path—even an else arm that a constant condition 1 would skip at runtime!
→
2 · Worked step-by-step example Step-by-step worked trace for lesson 7 Both Arms of if/else Must Match Promised [i32] Join Shape Then arm: 7 (i32) Matches [i32] Else arm: 8 (f64) [f64] != [i32] -> REJECT Join expects [i32] Then + 1 -> i32.add Change else value to i32.const 8 so both incoming paths agree. Worked Example: Condition = 1, Then = i32, Else = f64
Condition i32.const 1 enters if (results: i32). Then arm: pushes 7 (i32) → matches promised [i32].Else arm: pushes 8 (f64) → verifier checks [f64] against promised [i32] → rejected! Even though runtime condition 1 would never enter else, static verification checks all paths before running. Result: Both single-pass and two-pass CFG verifiers reject the mismatched else arm before execution begins.
Read the case Condition 1 → then: push 7 i32 → join
Condition 0 → else: push 8 f64 → join
Join requires [i32] → push 1 → i32.add
≡
3 · Bytecode stepper (explore before quizzing) A single-pass validator reads each instruction once. It checks the first arm at else and the second at end, using the saved label. A two-pass CFG design first builds the arrows. It then carries type lists along them and checks that incoming lists agree at each join. Both designs find the bad else path in this example.
Bytecode is the list of machine instructions below. Step through Check types and Run values before answering the prediction below.
Check types Instruction step Step 0Ready 0 / 6
Start with an empty stack. Read the instructions in order.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
Step forward →
Step 1i32.const 1 / 6
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 2if 2 / 6
Open if at stack height 0.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 3i32.const 3 / 6
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 4else 4 / 6
Check the first arm. Start the other arm with the same input types.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 5f64.const 5 / 6
Push the type f64.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right f64
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 6end 6 / 6
Type mismatch: expected i32, found f64.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack before rejection · top at right f64
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Types rejected
Run values Execution is blocked. Type mismatch: expected i32, found f64.
Compare the two-pass graph check Pass 1 builds the arrows. From the condition, one arrow reaches instruction 02 and the other reaches 04. Both paths then join before instruction 06.
Pass 2 compares what each arrow carries with the promised i32. The test value 1 selects a path only when the program runs.
Incoming path Stack at join Match Then [i32] yes Else [f64] no
?
4 · Make a prediction A run would take the then path. Can this program pass the verifier? ↗
5 · Repair the program Make both arms keep their numeric values and satisfy the join. The final add must produce an i32. Set the condition to 0 Inspect this edit. Changing the chosen arrow leaves the else path’s type unchanged. Both paths still face the same check.
Types rejected Run blocked Calls 0 Writes 0
Step through this edit Check types Instruction step Step 0Ready 0 / 6
Start with an empty stack. Read the instructions in order.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
Step forward →
Step 1i32.const 1 / 6
Push the type i32.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 2if 2 / 6
Open if at stack height 0.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 3i32.const 3 / 6
Push the type i32.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 4else 4 / 6
Check the first arm. Start the other arm with the same input types.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 5f64.const 5 / 6
Push the type f64.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right f64
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 6end 6 / 6
Type mismatch: expected i32, found f64.
Bytecode instruction address 00 i32.const 001 if → i3202 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack before rejection · top at right f64
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Types rejected
Run values Execution is blocked. Type mismatch: expected i32, found f64.
Compare the two-pass graph check Pass 1 builds the arrows. From the condition, one arrow reaches instruction 02 and the other reaches 04. Both paths then join before instruction 06.
Pass 2 compares what each arrow carries with the promised i32. The test value 0 selects a path only when the program runs.
Incoming path Stack at join Match Then [i32] yes Else [f64] no
Make the if promise f64 Inspect this edit. Now the first arm fails at else: 7 has type i32. The instruction after the join also needs an integer.
Types rejected Run blocked Calls 0 Writes 0
Step through this edit Check types Instruction step Step 0Ready 0 / 4
Start with an empty stack. Read the instructions in order.
Bytecode instruction address 00 i32.const 101 if → f6402 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
Step forward →
Step 1i32.const 1 / 4
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → f6402 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 2if 2 / 4
Open if at stack height 0.
Bytecode instruction address 00 i32.const 101 if → f6402 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 3i32.const 3 / 4
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → f6402 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 4else 4 / 4
Type mismatch: expected f64, found i32.
Bytecode instruction address 00 i32.const 101 if → f6402 i32.const 703 else04 f64.const 805 end06 i32.const 107 i32.addOperand stack before rejection · top at right i32
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Types rejected
Run values Execution is blocked. Type mismatch: expected f64, found i32.
Compare the two-pass graph check Pass 1 builds the arrows. From the condition, one arrow reaches instruction 02 and the other reaches 04. Both paths then join before instruction 06.
Pass 2 compares what each arrow carries with the promised f64. The test value 1 selects a path only when the program runs.
Incoming path Stack at join Match Then [i32] no Else [f64] yes
Push the else arm’s 8 as i32 Repair confirmed. Both arrows now carry a single i32. At runtime the condition chooses 7, then the add returns 8.
Types accepted Run finished Calls 0 Writes 0
Step through this edit Check types Instruction step Step 0Ready 0 / 8
Start with an empty stack. Read the instructions in order.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
Step forward →
Step 1i32.const 1 / 8
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 2if 2 / 8
Open if at stack height 0.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 3i32.const 3 / 8
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 4else 4 / 8
Check the first arm. Start the other arm with the same input types.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 5i32.const 5 / 8
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0 else h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 6end 6 / 8
Close this label. Restore its declared result types.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 7i32.const 7 / 8
Push the type i32.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Step forward →
Step 8i32.add 8 / 8
Check two i32 inputs. Push one i32 result.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 – 65528
– 65529
– 65530
– 65531
– 65532
– 65533
– 65534
– 65535
× 65536+
Type checking does not read or write bytes.
← Back Types accepted
Run values Instruction step Step 0Ready 0 / 7
Start with an empty stack and one page of zero bytes.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
Step forward →
Step 1i32.const 1 / 7
Push the value 1.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 1
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 2if 2 / 7
Enter the if body.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right [ ] Empty
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 3i32.const 3 / 7
Push the value 7.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 7
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 4else 4 / 7
The first arm finished. Skip the other arm.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 7
Control label stack innermost at right function h=0 if h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 5end 5 / 7
Leave the if with its result values.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 7
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 6i32.const 6 / 7
Push the value 1.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 7 i32 1
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Step forward →
Step 7i32.add 7 / 7
Add 7 and 1.
Bytecode instruction address 00 i32.const 101 if → i3202 i32.const 703 else04 i32.const 805 end06 i32.const 107 i32.addOperand stack top at right i32 8
Control label stack innermost at right function h=0
Each label keeps its entry height (h = stack height when the block opened).
Linear memory Tail of page 0 00 65528
00 65529
00 65530
00 65531
00 65532
00 65533
00 65534
00 65535
× 65536+
Each pair is one byte in base sixteen. The striped guard region marks addresses outside the page.
← Back Run finished
Compare the two-pass graph check Pass 1 builds the arrows. From the condition, one arrow reaches instruction 02 and the other reaches 04. Both paths then join before instruction 06.
Pass 2 compares what each arrow carries with the promised i32. The test value 1 selects a path only when the program runs.
Incoming path Stack at join Match Then [i32] yes Else [i32] yes
{ }
Code workshop Implement agrees in my-rules.mjs. Compare every incoming type list with the list promised at the join. The first command makes your own copy of the starter if needed. Edit the named function, then run the second command.
cp -n workshop/starter.mjs my-rules.mjs
node workshop/check.mjs 7 ./my-rules.mjsOptional worked example in a separate file Model the second pass for this join. Run the check with both incoming lists. Change the else list to make it pass.
function agrees(incoming, expected) {
return incoming.every(path =>
path.length === expected.length &&
path.every((type, i) => type === expected[i]))
}
console.log(agrees([["i32"], ["f64"]], ["i32"]))The comparison returns false. In a streaming checker, use the same comparison on each arm as it closes. The surrounding label already holds the expected list, so this check can run without storing the arrows.
Key Takeaway & Next Up WebAssembly’s structured labels enable fast single-pass verification that catches type mismatches on every reachable path—including untaken if/else arms.
Next: Finally, put everything together to audit and patch a brand-new plugin before sign-off!
Edit the bytecode Change the numbered inputs or instructions and run the checker again. Each run starts with a fresh page. This editor accepts a JSON object containing the decoded instructions.
Program Check and run
Free to Learn: Build a WebAssembly Stack-Machine Verifier & Linear-Memory Sandbox Lab