test: Use vec::as_imm_buf in bug-2470-bounds-check-overflow.rs

This commit is contained in:
Patrick Walton 2012-09-14 12:14:39 -07:00
parent 044fbea416
commit 6a3756b0ba

View file

@ -9,7 +9,7 @@ fn main() {
// huge).
let x = ~[1u,2u,3u];
do vec::as_buf(x) |p, _len| {
do vec::as_imm_buf(x) |p, _len| {
let base = p as uint; // base = 0x1230 say
let idx = base / sys::size_of::<uint>(); // idx = 0x0246 say
error!("ov1 base = 0x%x", base);
@ -21,4 +21,4 @@ fn main() {
// This should fail.
error!("ov1 0x%x", x[idx]);
}
}
}