Skip to content

Commit 55a777c

Browse files
committed
Auto merge of #69450 - cuviper:llvm-scev-no-wrap, r=nikic
Cherry-pick the LLVM fix for #69225 An additional reproducer was provided in #69225 -- the new testcase here -- which still crashes even after #69241 reverted #67174. Now this pull request updates LLVM with the cherry-picked reversion of its own. This is also going to stable in #69444. I have not tried to reapply #67174 yet -- cc @kraai @shahn
2 parents 6fd8798 + 6e84699 commit 55a777c

File tree

2 files changed

+34
-1
lines changed

2 files changed

+34
-1
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// run-fail
2+
// compile-flags: -C opt-level=3
3+
// error-pattern: index out of bounds: the len is 0 but the index is 16777216
4+
// ignore-wasm no panic or subprocess support
5+
// ignore-emscripten no panic or subprocess support
6+
7+
fn do_test(x: usize) {
8+
let mut arr = vec![vec![0u8; 3]];
9+
10+
let mut z = vec![0];
11+
for arr_ref in arr.iter_mut() {
12+
for y in 0..x {
13+
for _ in 0..1 {
14+
z.reserve_exact(x);
15+
let iterator = std::iter::repeat(0).take(x);
16+
let mut cnt = 0;
17+
iterator.for_each(|_| {
18+
z[0] = 0;
19+
cnt += 1;
20+
});
21+
let a = y * x;
22+
let b = (y + 1) * x - 1;
23+
let slice = &mut arr_ref[a..b];
24+
slice[1 << 24] += 1;
25+
}
26+
}
27+
}
28+
}
29+
30+
fn main() {
31+
do_test(1);
32+
do_test(2);
33+
}

0 commit comments

Comments
 (0)