Commit 95f1cdb2 authored by Stefan Behnel's avatar Stefan Behnel

catch C code error of unset temp results with an assert at code generation time

--HG--
extra : amend_source : a1b27560de97695dde4b9fea41a39f7f10de736c
parent 457c0ee4
...@@ -344,6 +344,7 @@ class ExprNode(Node): ...@@ -344,6 +344,7 @@ class ExprNode(Node):
def result(self): def result(self):
if self.is_temp: if self.is_temp:
assert self.temp_code
return self.temp_code return self.temp_code
else: else:
return self.calculate_result_code() return self.calculate_result_code()
...@@ -616,7 +617,7 @@ class ExprNode(Node): ...@@ -616,7 +617,7 @@ class ExprNode(Node):
# postponed from self.generate_evaluation_code() # postponed from self.generate_evaluation_code()
self.generate_subexpr_disposal_code(code) self.generate_subexpr_disposal_code(code)
self.free_subexpr_temps(code) self.free_subexpr_temps(code)
if self.result(): if self.temp_code:
if self.type.is_pyobject: if self.type.is_pyobject:
code.put_decref_clear(self.result(), self.ctype()) code.put_decref_clear(self.result(), self.ctype())
elif self.type.is_memoryviewslice: elif self.type.is_memoryviewslice:
......
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