One more buffer fix.
authorRobert Bradshaw <robertwb@math.washington.edu>
Fri, 12 Nov 2010 08:52:02 +0000 (00:52 -0800)
committerRobert Bradshaw <robertwb@math.washington.edu>
Fri, 12 Nov 2010 08:52:02 +0000 (00:52 -0800)
Cython/Compiler/ParseTreeTransforms.py

index 6692ca08fee2f68914ef36a7d4651c8d8021a5f8..0a21e0bd3fcbd4e149275245db8ab6c32d22b363 100644 (file)
@@ -1220,7 +1220,9 @@ class ExpandInplaceOperators(CythonTransform):
             return node
 
         def side_effect_free_reference(node, setting=False):
-            if node.type.is_pyobject and not setting:
+            if isinstance(node, NameNode):
+                return node, []
+            elif node.type.is_pyobject and not setting:
                 node = LetRefNode(node)
                 return node, [node]
             elif isinstance(node, IndexNode):
@@ -1232,8 +1234,6 @@ class ExpandInplaceOperators(CythonTransform):
             elif isinstance(node, AttributeNode):
                 obj, temps = side_effect_free_reference(node.obj)
                 return AttributeNode(node.pos, obj=obj, attribute=node.attribute), temps
-            elif isinstance(node, NameNode):
-                return node, []
             else:
                 node = LetRefNode(node)
                 return node, [node]