From: Stefan Behnel Date: Sat, 11 Dec 2010 00:11:00 +0000 (+0100) Subject: temp result name of YieldExprNode must be allocated in the resume code, not before it X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=452d378cc4e2dde5145191e6169e9d1086228b13;p=cython.git temp result name of YieldExprNode must be allocated in the resume code, not before it --- 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)))