test: Use vec::as_imm_buf in bug-2470-bounds-check-overflow.rs
This commit is contained in:
parent
044fbea416
commit
6a3756b0ba
1 changed files with 2 additions and 2 deletions
|
|
@ -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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue