Skip to content

Commit 15df395

Browse files
committed
rustc: Remove remaining non-inbounds GEPs
1 parent 3a4c96a commit 15df395

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/rustc/middle/trans/base.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ fn mk_obstack_token(ccx: crate_ctxt, fcx: fn_ctxt) ->
288288
// return type, use bump_ptr().
289289
fn ptr_offs(bcx: block, base: ValueRef, sz: ValueRef) -> ValueRef {
290290
let raw = PointerCast(bcx, base, T_ptr(T_i8()));
291-
GEP(bcx, raw, [sz])
291+
InBoundsGEP(bcx, raw, [sz])
292292
}
293293

294294
// 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,
24022402
trans_fail(bcx, some(ex.span), "bounds check")
24032403
};
24042404
let elt = if check type_has_static_size(ccx, unit_ty) {
2405-
let elt_1 = GEP(bcx, body, [ix_val]);
2405+
let elt_1 = InBoundsGEP(bcx, body, [ix_val]);
24062406
let llunitty = type_of(ccx, unit_ty);
24072407
PointerCast(bcx, elt_1, T_ptr(llunitty))
24082408
} else {
24092409
body = PointerCast(bcx, body, T_ptr(T_i8()));
2410-
GEP(bcx, body, [scaled_ix])
2410+
InBoundsGEP(bcx, body, [scaled_ix])
24112411
};
24122412
ret lval_owned(bcx, elt);
24132413
}

0 commit comments

Comments
 (0)