Skip to content

Commit

Permalink
some UB gets masked by optimizations
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Apr 18, 2020
1 parent c6ab275 commit 0345ee4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
4 changes: 2 additions & 2 deletions tests/compile-fail/dangling_pointers/dyn_size.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// should find the bug even without these
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
// should find the bug even without these, but gets masked by optimizations
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0

struct SliceWithHead(u8, [u8]);

Expand Down
4 changes: 2 additions & 2 deletions tests/compile-fail/unaligned_pointers/dyn_alignment.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// should find the bug even without these
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows
// should find the bug even without these, but gets masked by optimizations
// compile-flags: -Zmiri-disable-validation -Zmiri-disable-stacked-borrows -Zmir-opt-level=0

#[repr(align(256))]
#[derive(Debug)]
Expand Down
3 changes: 2 additions & 1 deletion tests/compile-fail/validity/nonzero.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// compile-flags: -Zmir-opt-level=1
// gets masked by optimizations
// compile-flags: -Zmir-opt-level=0
#![feature(rustc_attrs)]
#![allow(unused_attributes)]

Expand Down

0 comments on commit 0345ee4

Please sign in to comment.