Commit f0f22dce authored by dbarbera's avatar dbarbera
Browse files

Fixed for-in loop with SequenceOf Sequence types

parent 8935cc0c
......@@ -548,7 +548,10 @@ def generate_for_iterable(loop):
# load block
g.builder.position_at_end(load_block)
idx_var = g.builder.load(idx_ptr)
generate_assign(var_ptr, g.builder.load(g.builder.gep(array_ptr, [g.zero, idx_var])))
if element_typ.kind == core.TYPE_STRUCT:
generate_assign(var_ptr, g.builder.gep(array_ptr, [g.zero, idx_var]))
else:
generate_assign(var_ptr, g.builder.load(g.builder.gep(array_ptr, [g.zero, idx_var])))
g.builder.branch(body_block)
# body block
......
......@@ -6,6 +6,8 @@ else
20
1
2
1
3
label1
label2
label3
Supports Markdown
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