Skip to content

Commit 0345ee4

Browse files
committed
some UB gets masked by optimizations
1 parent c6ab275 commit 0345ee4

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

tests/compile-fail/dangling_pointers/dyn_size.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// should find the bug even without these
2-
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
1+
// should find the bug even without these, but gets masked by optimizations
2+
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0
33

44
struct SliceWithHead(u8, [u8]);
55

tests/compile-fail/unaligned_pointers/dyn_alignment.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// should find the bug even without these
2-
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
1+
// should find the bug even without these, but gets masked by optimizations
2+
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0
33

44
#[repr(align(256))]
55
#[derive(Debug)]

tests/compile-fail/validity/nonzero.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// compile-flags: -Zmir-opt-level=1
1+
// gets masked by optimizations
2+
// compile-flags: -Zmir-opt-level=0
23
#![feature(rustc_attrs)]
34
#![allow(unused_attributes)]
45

0 commit comments

Comments
 (0)