Commit 07249180 authored by Stefan Behnel's avatar Stefan Behnel

Prevent ExprStatNode value casting for "void" type.

parent 72cb404f
...@@ -5055,7 +5055,10 @@ class ExprStatNode(StatNode): ...@@ -5055,7 +5055,10 @@ class ExprStatNode(StatNode):
self.expr.result_is_used = False # hint that .result() may safely be left empty self.expr.result_is_used = False # hint that .result() may safely be left empty
self.expr.generate_evaluation_code(code) self.expr.generate_evaluation_code(code)
if not self.expr.is_temp and self.expr.result(): if not self.expr.is_temp and self.expr.result():
code.putln("(void)(%s);" % self.expr.result()) result = self.expr.result()
if not self.expr.type.is_void:
result = "(void)(%s)" % result
code.putln("%s;" % result)
self.expr.generate_disposal_code(code) self.expr.generate_disposal_code(code)
self.expr.free_temps(code) self.expr.free_temps(code)
......
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