diff --git a/src/som/compiler/bc/method_generation_context.py b/src/som/compiler/bc/method_generation_context.py index 4114d76c..06f1af4b 100644 --- a/src/som/compiler/bc/method_generation_context.py +++ b/src/som/compiler/bc/method_generation_context.py @@ -276,8 +276,7 @@ def get_max_context_level(self): def add_bytecode(self, bytecode, stack_effect): self._current_stack_depth += stack_effect - if self._current_stack_depth > self.max_stack_depth: - self.max_stack_depth = self._current_stack_depth + self.max_stack_depth = max(self.max_stack_depth, self._current_stack_depth) self._bytecode.append(bytecode) self._last_4_bytecodes[0] = self._last_4_bytecodes[1]