diff options
| author | Brian Anderson <banderson@mozilla.com> | 2012-03-05 15:12:36 -0800 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2012-03-05 15:12:36 -0800 |
| commit | 15df3950ad4a1d2e9deb30d0ebdcb8dc7da00b63 (patch) | |
| tree | dc449f38084d9ea3c1fd41dd2b23968a66ecf13b /src/rustc | |
| parent | 3a4c96a196b7b4578b3beec26df22975e2f1bb43 (diff) | |
| download | rust-15df3950ad4a1d2e9deb30d0ebdcb8dc7da00b63.tar.gz rust-15df3950ad4a1d2e9deb30d0ebdcb8dc7da00b63.zip | |
rustc: Remove remaining non-inbounds GEPs
Diffstat (limited to 'src/rustc')
| -rw-r--r-- | src/rustc/middle/trans/base.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs index 12beb363d04..d97e7017246 100644 --- a/src/rustc/middle/trans/base.rs +++ b/src/rustc/middle/trans/base.rs @@ -288,7 +288,7 @@ fn mk_obstack_token(ccx: crate_ctxt, fcx: fn_ctxt) -> // return type, use bump_ptr(). fn ptr_offs(bcx: block, base: ValueRef, sz: ValueRef) -> ValueRef { let raw = PointerCast(bcx, base, T_ptr(T_i8())); - GEP(bcx, raw, [sz]) + InBoundsGEP(bcx, raw, [sz]) } // Increment a pointer by a given amount and then cast it to be a pointer @@ -2402,12 +2402,12 @@ fn trans_index(cx: block, ex: @ast::expr, base: @ast::expr, trans_fail(bcx, some(ex.span), "bounds check") }; let elt = if check type_has_static_size(ccx, unit_ty) { - let elt_1 = GEP(bcx, body, [ix_val]); + let elt_1 = InBoundsGEP(bcx, body, [ix_val]); let llunitty = type_of(ccx, unit_ty); PointerCast(bcx, elt_1, T_ptr(llunitty)) } else { body = PointerCast(bcx, body, T_ptr(T_i8())); - GEP(bcx, body, [scaled_ix]) + InBoundsGEP(bcx, body, [scaled_ix]) }; ret lval_owned(bcx, elt); } |
