Skip to content

Commit 6a3756b

Browse files
committed
test: Use vec::as_imm_buf in bug-2470-bounds-check-overflow.rs
1 parent 044fbea commit 6a3756b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/run-fail/bug-2470-bounds-check-overflow.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ fn main() {
99
// huge).
1010

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

0 commit comments

Comments
 (0)