Commit 93f66902 authored by Stefan Behnel's avatar Stefan Behnel

always wrap for-iterator node in NextNode after analysing it (might have been replaced)

parent 4b6385ce
...@@ -5599,11 +5599,10 @@ class ForInStatNode(LoopNode, StatNode): ...@@ -5599,11 +5599,10 @@ class ForInStatNode(LoopNode, StatNode):
# looked up in the outer scope # looked up in the outer scope
iterator_env = NonLocalScopeWrapper(iterator_env) iterator_env = NonLocalScopeWrapper(iterator_env)
self.iterator = self.iterator.analyse_expressions(iterator_env) self.iterator = self.iterator.analyse_expressions(iterator_env)
if self.item is None: # rewrap in NextNode
# Hack. Sometimes analyse_declarations not called. import ExprNodes
import ExprNodes self.item = ExprNodes.NextNode(
self.item = ExprNodes.NextNode( self.iterator, lives_in_outer_scope=self.first_in_genexp)
self.iterator, lives_in_outer_scope=self.first_in_genexp)
self.item = self.item.analyse_expressions(env) self.item = self.item.analyse_expressions(env)
if ((self.iterator.type.is_ptr or self.iterator.type.is_array) and if ((self.iterator.type.is_ptr or self.iterator.type.is_array) and
self.target.type.assignable_from(self.iterator.type)): self.target.type.assignable_from(self.iterator.type)):
......
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