From 452d378cc4e2dde5145191e6169e9d1086228b13 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 11 Dec 2010 01:11:00 +0100 Subject: [PATCH] temp result name of YieldExprNode must be allocated in the resume code, not before it --- Cython/Compiler/ExprNodes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 1fb7e780..d81ae282 100755 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -4985,7 +4985,6 @@ class YieldExprNode(ExprNode): def generate_evaluation_code(self, code): self.label_name = code.new_label('resume_from_yield') code.use_label(self.label_name) - self.allocate_temp_result(code) if self.arg: self.arg.generate_evaluation_code(code) self.arg.make_owned_reference(code) @@ -5019,6 +5018,7 @@ class YieldExprNode(ExprNode): code.putln('%s = %s->%s;' % (cname, Naming.cur_scope_cname, save_cname)) if type.is_pyobject: code.putln('%s->%s = 0;' % (Naming.cur_scope_cname, save_cname)) + self.allocate_temp_result(code) code.putln('%s = %s; %s' % (self.result(), Naming.sent_value_cname, code.error_goto_if_null(self.result(), self.pos))) -- 2.26.2