From: Stefan Behnel Date: Wed, 3 Dec 2008 20:57:18 +0000 (+0100) Subject: some cleanup, fix temp handling in 'if' conditions X-Git-Tag: 0.11-beta~168 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=9132d124eab021beadb98600ad62d24140e62b94;p=cython.git some cleanup, fix temp handling in 'if' conditions --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 41f304c4..eab1e5b4 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -3382,15 +3382,10 @@ class RaiseStatNode(StatNode): else: code.putln( "__Pyx_ReRaise();") - if self.exc_type: - self.exc_type.generate_disposal_code(code) - self.exc_type.free_temps(code) - if self.exc_value: - self.exc_value.generate_disposal_code(code) - self.exc_value.free_temps(code) - if self.exc_tb: - self.exc_tb.generate_disposal_code(code) - self.exc_tb.free_temps(code) + for obj in (self.exc_type, self.exc_value, self.exc_tb): + if obj: + obj.generate_disposal_code(code) + obj.free_temps(code) code.putln( code.error_goto(self.pos)) @@ -3548,6 +3543,8 @@ class IfClauseNode(Node): code.putln( "if (%s) {" % self.condition.result()) + self.condition.generate_disposal_code(code) + self.condition.free_temps(code) self.body.generate_execution_code(code) #code.putln( # "goto %s;" %