Commit 36e017b2 authored by Robert Bradshaw's avatar Robert Bradshaw

One more buffer fix.

parent 32f6b9ce
...@@ -1220,7 +1220,9 @@ class ExpandInplaceOperators(CythonTransform): ...@@ -1220,7 +1220,9 @@ class ExpandInplaceOperators(CythonTransform):
return node return node
def side_effect_free_reference(node, setting=False): 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) node = LetRefNode(node)
return node, [node] return node, [node]
elif isinstance(node, IndexNode): elif isinstance(node, IndexNode):
...@@ -1232,8 +1234,6 @@ class ExpandInplaceOperators(CythonTransform): ...@@ -1232,8 +1234,6 @@ class ExpandInplaceOperators(CythonTransform):
elif isinstance(node, AttributeNode): elif isinstance(node, AttributeNode):
obj, temps = side_effect_free_reference(node.obj) obj, temps = side_effect_free_reference(node.obj)
return AttributeNode(node.pos, obj=obj, attribute=node.attribute), temps return AttributeNode(node.pos, obj=obj, attribute=node.attribute), temps
elif isinstance(node, NameNode):
return node, []
else: else:
node = LetRefNode(node) node = LetRefNode(node)
return node, [node] return node, [node]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment