mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 04:56:25 +03:00
test: Use vec::as_imm_buf in bug-2470-bounds-check-overflow.rs
This commit is contained in:
@@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user