mirror of
https://github.com/pezkuwichain/wasm-instrument.git
synced 2026-06-11 21:11:05 +00:00
Fix counting of the local variables
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.
This commit is contained in:
@@ -93,6 +93,7 @@ mod stack_height {
|
||||
def_stack_height_test!(table);
|
||||
def_stack_height_test!(global);
|
||||
def_stack_height_test!(imports);
|
||||
def_stack_height_test!(many_locals);
|
||||
}
|
||||
|
||||
mod gas {
|
||||
|
||||
Reference in New Issue
Block a user