From a3cbdc661cec57ab07bb209637b10d9e6d6bbb36 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Mon, 13 Dec 2010 11:16:04 -0800 Subject: Set the new vec fill-size on the compiler side, as in rustboot. Un-XFAIL first 3 vec tests. --- src/Makefile | 3 +++ src/comp/middle/trans.rs | 5 +++++ 2 files changed, 8 insertions(+) (limited to 'src') diff --git a/src/Makefile b/src/Makefile index 768d89d9..2c421534 100644 --- a/src/Makefile +++ b/src/Makefile @@ -558,6 +558,9 @@ TEST_XFAILS_SELF := $(filter-out \ u8-incr-decr.rs \ uint.rs \ unit.rs \ + vec.rs \ + vec-in-tup.rs \ + vec-late-init.rs \ while-and-do-while.rs \ writealias.rs \ ) \ diff --git a/src/comp/middle/trans.rs b/src/comp/middle/trans.rs index 197909a1..dbf96f34 100644 --- a/src/comp/middle/trans.rs +++ b/src/comp/middle/trans.rs @@ -1376,6 +1376,7 @@ fn trans_index(@block_ctxt cx, &ast.span sp, @ast.expr base, auto lim = ix.bcx.build.GEP(v, vec(C_int(0), C_int(abi.vec_elt_fill))); lim = ix.bcx.build.Load(lim); + auto bounds_check = ix.bcx.build.ICmp(lib.llvm.LLVMIntULT, scaled_ix, lim); @@ -1582,6 +1583,10 @@ impure fn trans_vec(@block_ctxt cx, vec[@ast.expr] args, sub = copy_ty(src_res.bcx, true, dst_elt, src_res.val, unit_ty); i += 1; } + auto fill = sub.bcx.build.GEP(vec_val, + vec(C_int(0), C_int(abi.vec_elt_fill))); + sub.bcx.build.Store(data_sz, fill); + ret res(sub.bcx, vec_val); } -- cgit v1.2.3