diff --git a/lib/src/compiler/context.rs b/lib/src/compiler/context.rs index aa9a0571..bc7f86f5 100644 --- a/lib/src/compiler/context.rs +++ b/lib/src/compiler/context.rs @@ -189,9 +189,7 @@ impl VarStack { self.used += capacity; self.frame_id += 1; - if self.used * Var::mem_size() - > wasm::VARS_STACK_END - wasm::VARS_STACK_START - { + if self.used > wasm::MAX_VARS { panic!("variables stack overflow"); } @@ -273,9 +271,7 @@ impl Var { if self.index >= from_index { self.index += shift_amount; } - if self.index * Var::mem_size() - >= wasm::VARS_STACK_END - wasm::VARS_STACK_START - { + if self.index >= wasm::MAX_VARS { panic!("variables stack overflow during shift"); } }