Commit 5257cc32 authored by Stefan Behnel's avatar Stefan Behnel

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

parent a3d44612
......@@ -5589,10 +5589,8 @@ class ForInStatNode(LoopNode, StatNode):
def analyse_expressions(self, env):
self.target = self.target.analyse_target_types(env)
self.iterator = self.iterator.analyse_expressions(env)
if self.item is None:
# Hack. Sometimes analyse_declarations not called.
import ExprNodes
self.item = ExprNodes.NextNode(self.iterator)
import ExprNodes
self.item = ExprNodes.NextNode(self.iterator) # must rewrap after analysis
self.item = self.item.analyse_expressions(env)
if (self.iterator.type.is_ptr or self.iterator.type.is_array) and \
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