From 9132d124eab021beadb98600ad62d24140e62b94 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Wed, 3 Dec 2008 21:57:18 +0100 Subject: [PATCH] some cleanup, fix temp handling in 'if' conditions --- Cython/Compiler/Nodes.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) 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;" % -- 2.26.2