Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to nightly-2024-12-03 #15

Merged
merged 28 commits into from
Dec 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1932242
Update to nightly-2024-02-15
hermanventer Nov 14, 2024
dfe3be2
Update to nightly-2024-03-01
hermanventer Nov 14, 2024
85359b2
Update to nightly-2024-03-15
hermanventer Nov 15, 2024
7bd7b20
Update to nightly-2024-04-01
hermanventer Nov 18, 2024
cfbf9e2
Update to nightly-2024-04-15
hermanventer Nov 19, 2024
5892b5e
Update to nightly-2024-05-01
hermanventer Nov 20, 2024
0508a72
Update to nightly-2024-05-15
hermanventer Nov 21, 2024
a96f8c2
Update to nightly-2024-06-01
hermanventer Nov 21, 2024
d983533
Update to nightly-2024-06-02
hermanventer Nov 21, 2024
eda37da
Update to nightly-2024-06-06
hermanventer Nov 22, 2024
8ec339b
Update to nightly-2024-06-08
hermanventer Nov 22, 2024
0810012
Update to nightly-2024-06-10
hermanventer Nov 22, 2024
c168ca0
Update to nightly-2024-07-01
hermanventer Nov 22, 2024
d9eb7a6
Update to nightly-2024-07-15
hermanventer Nov 22, 2024
17d4f24
Update to nightly-2024-08-01
hermanventer Nov 22, 2024
c10bdda
Update to nightly-2024-08-15
hermanventer Nov 26, 2024
a470f84
Update to nightly-2024-09-01
hermanventer Nov 26, 2024
7ecb481
Update to nightly-2024-09-15
hermanventer Nov 26, 2024
06f8f29
Update to nightly-2024-10-01
hermanventer Nov 26, 2024
ea62b68
Update to nightly-2024-10-15
hermanventer Nov 26, 2024
db706ad
Update to nightly-2024-11-01
hermanventer Nov 26, 2024
8662c33
Update to nightly-2024-11-15
hermanventer Nov 28, 2024
1529955
Update to nightly-2024-12-01
hermanventer Dec 3, 2024
62564af
Update to nightly-2024-12-02
hermanventer Dec 3, 2024
06a93e4
Keep up with Clippy
hermanventer Dec 3, 2024
b5f68ca
Tweak CI
hermanventer Dec 3, 2024
68a2400
nightly-2024-12-03
hermanventer Dec 3, 2024
1fd77bf
Try to fix Windows build
hermanventer Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/mirai_on_mirai.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ jobs:
cargo install --force --path ./checker --no-default-features --features=vcpkg
- name: Run MIRAI on MIRAI
run: |
cargo mirai --no-default-features
cargo mirai --no-default-features --features=vcpkg
if: matrix.os != 'windows-latest'
30 changes: 15 additions & 15 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,22 +42,22 @@ jobs:
cargo test --all -- --test-threads=1
env:
CARGO_INCREMENTAL: 0
RUSTFLAGS: "-Zprofile -Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"
RUSTFLAGS: "-Ccodegen-units=1 -Copt-level=0 -Clink-dead-code -Coverflow-checks=off -Zpanic_abort_tests"

# - name: Setup grcov
# run: |
# cargo install grcov
#
# - name: Run grcov
# run: |
# zip -0 cov.zip $(find . -name "mirai*.gc*" -print)
# grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info
#
# - name: Upload coverage data to codecov.io
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: "lcov.info"
# - name: Setup grcov
# run: |
# cargo install grcov
#
# - name: Run grcov
# run: |
# zip -0 cov.zip $(find . -name "mirai*.gc*" -print)
# grcov cov.zip -s . -t lcov --llvm --ignore-not-existing --ignore "/*" -o lcov.info
#
# - name: Upload coverage data to codecov.io
# uses: codecov/codecov-action@v3
# with:
# token: ${{ secrets.CODECOV_TOKEN }}
# files: "lcov.info"

mirai_on_mirai_ubuntu:
runs-on: ubuntu-latest
Expand Down
63 changes: 32 additions & 31 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions annotations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

// A set of macros and functions to use for annotating source files that are being checked with MIRAI

#![allow(unexpected_cfgs)]

/// Provides a way to specify a value that should be treated abstractly by the verifier.
/// The concrete argument provides type information to the verifier and a meaning for
/// the expression when compiled by the rust compiler.
Expand Down
Binary file modified binaries/summary_store.tar
Binary file not shown.
5 changes: 3 additions & 2 deletions checker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@ log = "*"
log-derive = "*"
mirai-annotations = { path = "../annotations" }
petgraph = "*"
proc-macro2 = "*"
rand = "*"
rayon = "*"
regex = "*"
rpds = { version = "*", features = ["serde"] }
rustc_tools_util = "*"
serde = { version = "=1.0.203", features = ["derive", "alloc", "rc"] }
serde = { version = "*", features = ["derive", "alloc", "rc"] }
serde_json = "*"
shellwords = "*"
sled = "*"
tar = "*"
tempfile = "*"
z3-sys = { version = "*", git = "https://github.com/prove-rs/z3.rs.git", optional = true }
z3-sys = { version = "*", git = "https://github.com/prove-rs/z3.rs.git", rev = "cb10013a2a0a017048b1d218bc734afa390f34ff", optional = true }

[dev-dependencies]
walkdir = "*"
Expand Down
70 changes: 55 additions & 15 deletions checker/src/abstract_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ pub trait AbstractValueTrait: Sized {
#[must_use]
fn cast(&self, target_type: ExpressionType) -> Self;
#[must_use]
fn compare(&self, other: Self) -> Self;
#[must_use]
fn conditional_expression(&self, consequent: Self, alternate: Self) -> Self;
#[must_use]
fn dereference(&self, target_type: ExpressionType) -> Self;
Expand Down Expand Up @@ -1797,6 +1799,17 @@ impl AbstractValueTrait for Rc<AbstractValue> {
// [0 & y] -> 0
return self.clone();
}
if matches!(other.expression, Expression::Reference(..)) {
if let Expression::CompileTimeConstant(ConstantDomain::U128(1))
| Expression::CompileTimeConstant(ConstantDomain::U128(3))
| Expression::CompileTimeConstant(ConstantDomain::U128(7)) = self.expression
{
// [1 & (&y)] -> 0
// [3 & (&y)] -> 0
// [7 & (&y)] -> 0
return Rc::new(ConstantDomain::U128(0).into());
}
}
// [x & x] -> x
if self.eq(&other) {
return other;
Expand Down Expand Up @@ -1987,6 +2000,18 @@ impl AbstractValueTrait for Rc<AbstractValue> {
}
}

/// Returns an element that is "self.cmp(other)".
#[logfn_inputs(TRACE)]
#[must_use]
fn compare(&self, other: Self) -> Self {
let zero = Rc::new(ConstantDomain::I128(0).into());
let one = Rc::new(ConstantDomain::I128(1).into());
let minus_one = Rc::new(ConstantDomain::I128(-1).into());
let eq = self.equals(other.clone());
let lt = self.less_than(other.clone());
eq.conditional_expression(zero, lt.conditional_expression(minus_one, one))
}

/// Returns an element that is "if self { consequent } else { alternate }".
#[logfn_inputs(TRACE)]
fn conditional_expression(
Expand Down Expand Up @@ -3253,7 +3278,19 @@ impl AbstractValueTrait for Rc<AbstractValue> {
fn intrinsic_bit_vector_unary(&self, bit_length: u8, name: KnownNames) -> Self {
match &self.expression {
Expression::CompileTimeConstant(v1) => {
let result = v1.intrinsic_bit_vector_unary(bit_length, name);
let result = match name {
KnownNames::StdIntrinsicsBitreverse | KnownNames::StdIntrinsicsBswap => {
v1.intrinsic_bit_vector_unary(bit_length, name)
}
KnownNames::StdIntrinsicsCtlz
| KnownNames::StdIntrinsicsCtlzNonzero
| KnownNames::StdIntrinsicsCtpop
| KnownNames::StdIntrinsicsCttz
| KnownNames::StdIntrinsicsCttzNonzero => {
v1.intrinsic_bit_counting_unary(bit_length, name)
}
_ => assume_unreachable!("invalid name for intrinsic {:?}", name),
};
if result != ConstantDomain::Bottom {
return Rc::new(result.into());
}
Expand Down Expand Up @@ -5589,19 +5626,20 @@ impl AbstractValueTrait for Rc<AbstractValue> {
.widen(&alternate.get_as_interval()),
Expression::Div { left, right } => left.get_as_interval().div(&right.get_as_interval()),
Expression::IntrinsicBitVectorUnary {
name, bit_length, ..
} => match name {
KnownNames::StdIntrinsicsCtlz
| KnownNames::StdIntrinsicsCtlzNonzero
| KnownNames::StdIntrinsicsCtpop
| KnownNames::StdIntrinsicsCttz
| KnownNames::StdIntrinsicsCttzNonzero => {
let min_value: IntervalDomain = IntervalDomain::from(0u128);
let max_value = IntervalDomain::from(*bit_length as u128);
min_value.widen(&max_value)
}
_ => interval_domain::BOTTOM,
},
name:
KnownNames::StdIntrinsicsCtlz
| KnownNames::StdIntrinsicsCtlzNonzero
| KnownNames::StdIntrinsicsCtpop
| KnownNames::StdIntrinsicsCttz
| KnownNames::StdIntrinsicsCttzNonzero,
bit_length,
..
} => {
let min_value: IntervalDomain = IntervalDomain::from(0u128);
let max_value = IntervalDomain::from(*bit_length as u128);
min_value.widen(&max_value)
}
Expression::IntrinsicBitVectorUnary { .. } => interval_domain::BOTTOM,
Expression::Join { left, right, .. } => {
left.get_as_interval().widen(&right.get_as_interval())
}
Expand Down Expand Up @@ -6596,7 +6634,9 @@ impl AbstractValueTrait for Rc<AbstractValue> {
length,
} => {
let refined_length = length.refine_with(path_condition, depth + 1);
AbstractValue::make_memcmp(left.clone(), right.clone(), refined_length)
let refined_left = left.refine_with(path_condition, depth + 1);
let refined_right = right.refine_with(path_condition, depth + 1);
AbstractValue::make_memcmp(refined_left, refined_right, refined_length)
}
Expression::Mul { left, right } => left
.refine_with(path_condition, depth + 1)
Expand Down
Loading
Loading