From 5824aa0bfd3c208c4b45ec34e11b4f0cdd2dd663 Mon Sep 17 00:00:00 2001 From: Zhan Rongrui <2742392377@qq.com> Date: Sat, 2 Sep 2023 11:42:52 +0000 Subject: [PATCH] fix --- sot/opcode_translator/executor/opcode_executor.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sot/opcode_translator/executor/opcode_executor.py b/sot/opcode_translator/executor/opcode_executor.py index 32d901b80..5d604dc49 100644 --- a/sot/opcode_translator/executor/opcode_executor.py +++ b/sot/opcode_translator/executor/opcode_executor.py @@ -1862,11 +1862,13 @@ def _break_graph_in_call( for i, stack_arg in enumerate(self.stack): # Avoid passing NULL as a parameter to the resume function - if isinstance(stack_arg, NullVariable): - if i < len(self.stack) - pop_n: - self._graph.pycode_gen.gen_load_object( - NullVariable(), f'dummy_var{i}', push_null=False - ) + if ( + isinstance(stack_arg, NullVariable) + and i < len(self.stack) - pop_n + ): + self._graph.pycode_gen.gen_load_object( + NullVariable(), f'dummy_var{i}', push_null=False + ) else: var_loader.load(stack_arg)