aboutsummaryrefslogtreecommitdiff
path: root/src/comp
diff options
context:
space:
mode:
authorGraydon Hoare <[email protected]>2010-12-10 17:46:47 -0800
committerGraydon Hoare <[email protected]>2010-12-10 17:46:47 -0800
commitf97242c255dfe07f1c8d3908d4bfd2942e1b2428 (patch)
tree98f138ad55a5e0f90bdbb5881d8d5e276059dfe1 /src/comp
parentImplement expr_vec. (diff)
downloadrust-f97242c255dfe07f1c8d3908d4bfd2942e1b2428.tar.xz
rust-f97242c255dfe07f1c8d3908d4bfd2942e1b2428.zip
Fix bad GEP and missing branch in iter_sequence; vec.rs compiles now.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/middle/trans.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs
index 34325d48..197909a1 100644
--- a/src/comp/middle/trans.rs
+++ b/src/comp/middle/trans.rs
@@ -857,11 +857,13 @@ fn iter_sequence(@block_ctxt cx,
auto body_cx = new_scope_block_ctxt(cx, "sequence-iter body");
auto next_cx = new_sub_block_ctxt(cx, "next");
+ cx.build.Br(cond_cx.llbb);
+
auto ix = cond_cx.build.Phi(T_int(), vec(C_int(0)), vec(cx.llbb));
auto end_test = cond_cx.build.ICmp(lib.llvm.LLVMIntEQ, ix, len);
cond_cx.build.CondBr(end_test, body_cx.llbb, next_cx.llbb);
- auto elt = body_cx.build.GEP(p0, vec(ix));
+ auto elt = body_cx.build.GEP(p0, vec(C_int(0), ix));
auto body_res = f(body_cx,
load_non_structural(body_cx, elt, elt_ty),
elt_ty);