mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-04-25 11:27:57 +00:00
19760b5835
The code assumed that the number of `Local` and number of locals is the same thing. In reality though it is not. `Local` actually represents a group of locals with the same type. The group can declare more than one variable and the number of them is returned by `Local::count`. In this PR we acknowledge this fact. Along the way we add a checked arithmetic for locals_count and max_stack_height summation.
11 lines
137 B
WebAssembly Text Format
11 lines
137 B
WebAssembly Text Format
(module
|
|
(func $one-group-many-locals
|
|
(local i64) (local i64) (local i32)
|
|
)
|
|
(func $main
|
|
(call
|
|
$one-group-many-locals
|
|
)
|
|
)
|
|
)
|