From ca53faeb24fe747ec47c521491336fded608d859 Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Fri, 26 Jan 2007 23:06:06 -0800 Subject: [PATCH] De-allocate function temp variables _after_ computing return value, in case an exception is thrown, caught, and said temp variables still need to be accessed. --- Cython/Compiler/Nodes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index bb0e8277..cfcb56be 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2933,8 +2933,6 @@ class ReturnStatNode(StatNode): if not self.return_type: # error reported earlier return - for entry in self.temps_in_use: - code.put_var_decref_clear(entry) if self.value: self.value.generate_evaluation_code(code) self.value.make_owned_reference(code) @@ -2951,6 +2949,8 @@ class ReturnStatNode(StatNode): "%s = %s;" % ( Naming.retval_cname, self.return_type.default_value)) + for entry in self.temps_in_use: + code.put_var_decref_clear(entry) code.putln( "goto %s;" % code.return_label) -- 2.26.2