Commit 41ab9f0b authored by Robert Bradshaw's avatar Robert Bradshaw

Fix subtle error in new temp allocation.

parent cd4d9281
...@@ -395,7 +395,7 @@ class ExprNode(Node): ...@@ -395,7 +395,7 @@ class ExprNode(Node):
self.result_code = None self.result_code = None
if debug_temp_alloc: if debug_temp_alloc:
print("%s Allocated result %s" % (self, self.result_code)) print("%s Allocated result %s" % (self, self.result_code))
def target_code(self): def target_code(self):
# Return code fragment for use as LHS of a C assignment. # Return code fragment for use as LHS of a C assignment.
return self.calculate_result_code() return self.calculate_result_code()
...@@ -599,7 +599,10 @@ class NewTempExprNode(ExprNode): ...@@ -599,7 +599,10 @@ class NewTempExprNode(ExprNode):
assert result is None assert result is None
def release_temp(self, env): def release_temp(self, env):
pass if self.is_temp:
pass
else:
self.release_subexpr_temps(env)
def pre_generate_result_code(self, code): def pre_generate_result_code(self, code):
if self.is_temp: if self.is_temp:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment