소스 검색

Fix a bug in UnaryInstruction

jonathanvdc 8 년 전
부모
커밋
4f83e248f7
1개의 변경된 파일5개의 추가작업 그리고 5개의 파일을 삭제
  1. 5 5
      kernel/modelverse_jit/tree_ir.py

+ 5 - 5
kernel/modelverse_jit/tree_ir.py

@@ -381,12 +381,12 @@ class UnaryInstruction(Instruction):
 
     def has_definition(self):
         """Tells if this instruction requires a definition."""
-        return self.operator.has_definition()
+        return self.operand.has_definition()
 
     def simplify(self):
         """Applies basic simplification to this instruction and its children."""
-        simple_operator = self.operator.simplify()
-        return UnaryInstruction(self.operator, simple_operator)
+        simple_operand = self.operand.simplify()
+        return UnaryInstruction(self.operator, simple_operand)
 
     def generate_python_use(self, code_generator):
         """Generates a Python expression that retrieves this instruction's
@@ -398,8 +398,8 @@ class UnaryInstruction(Instruction):
     def generate_python_def(self, code_generator):
         """Generates a Python statement that executes this instruction.
            The statement is appended immediately to the code generator."""
-        if self.operator.has_definition():
-            self.operator.generate_python_def(code_generator)
+        if self.operand.has_definition():
+            self.operand.generate_python_def(code_generator)
         else:
             code_generator.append_line('pass')