Selaa lähdekoodia

Fix a bug in UnaryInstruction

jonathanvdc 8 vuotta sitten
vanhempi
commit
4f83e248f7
1 muutettua tiedostoa jossa 5 lisäystä ja 5 poistoa
  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')