From 6fb8b96311ea4f14c5d6dc705b44351fd49707ee Mon Sep 17 00:00:00 2001 From: Dag Sverre Seljebotn Date: Sat, 29 Nov 2008 23:20:51 +0100 Subject: [PATCH] Converted IteratorNode to new temps, fixes #124 --- Cython/Compiler/ExprNodes.py | 2 +- tests/run/ticket_124.pyx | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 tests/run/ticket_124.pyx diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py index 0d20c53b..a29b2c67 100644 --- a/Cython/Compiler/ExprNodes.py +++ b/Cython/Compiler/ExprNodes.py @@ -1349,7 +1349,7 @@ class ImportNode(ExprNode): code.error_goto_if_null(self.result(), self.pos))) -class IteratorNode(ExprNode): +class IteratorNode(NewTempExprNode): # Used as part of for statement implementation. # # allocate_counter_temp/release_counter_temp needs to be called diff --git a/tests/run/ticket_124.pyx b/tests/run/ticket_124.pyx new file mode 100644 index 00000000..5f9b23a3 --- /dev/null +++ b/tests/run/ticket_124.pyx @@ -0,0 +1,8 @@ +""" +>>> spam(dict(test=2)) +False +""" +def spam(dict d): + for elm in d: + return False + return True -- 2.26.2