Comments (3)
I'm not really sure the above fix is the right way---at least it fixed the above issue, which happened while analyzing sqrt
(https://github.com/rust-lang/libm/blob/cb2ffdf5435d3302c97a27c8ce7de48e214de037/src/math/sqrt.rs#L151).
MIRAI tried to compute transmute(old(param_1): F64, U64)
/ two
^32
in numeric_shr
, but lf
was false
although it was transmuted to U64
.
However, MIRAI panics shortly after making more progress while analyzing the fma
function(https://github.com/rust-lang/libm/blob/cb2ffdf5435d3302c97a27c8ce7de48e214de037/src/math/fma.rs#L44).
from mirai.
The issue while analyzing the fma
function boils down to calling bv_cast
with the result of bv_overflows
.
bv_cast
expects ast
and mask
to have same sorts, as it calls Z3_mk_bvand(_, ast, mask)
(https://github.com/prove-rs/z3.rs/blob/26ddf7fb90ea62509bb235286024fc7f76319591/z3-sys/src/lib.rs#L2467).
However, if ast
gets returned from bv_overflows
, it has Boolean sort, due to the call to Z3_mk_not
(https://github.com/prove-rs/z3.rs/blob/26ddf7fb90ea62509bb235286024fc7f76319591/z3-sys/src/lib.rs#L2285).
mask
has BitVector sort.
The following is what happens:
get_as_bv_z3_ast(self: "Z3Solver",expression: (overflows((local_22(11): U64) - (local_20(11): U64))) as U64,num_bits: 64)
bv_cast(self: "Z3Solver",expression: overflows((local_22(11): U64) - (local_20(11): U64)),target_type: U64,num_bits: 64)
ast "(not (bvule |local_20(11)| |local_22(11)|))" has sort "Bool"
mask "#xffffffffffffffff" has sort "(_ BitVec 64)"
Error: operator is applied to arguments of the wrong sort
Not quite sure how to fix this though.
from mirai.
I have created a PR that fixes these issues.
from mirai.
Related Issues (20)
- MIRAI fails analysing: error: could not compile <bin> HOT 2
- feature request: Annotating traits for attaching tags HOT 3
- question: propagation through closure containing tagged values HOT 14
- suggestion: add example + usage in the README HOT 1
- Memory Usage for rebuild_std.sh HOT 3
- Question: Foreign contracts HOT 6
- Add JSON structure reporting HOT 1
- MIRAI only sees one member of a workspace HOT 4
- Compiler unexpectedly panicked when execute `cargo mirai`
- How to pass `--cfg` to mirai? HOT 1
- Does the behavior of add_tag!() and does_not_have_tag!() be affected by type and clone()? HOT 1
- Evaluate Profile-Guided Optimization (PGO) and LLVM BOLT
- No warnings shown for library methods HOT 6
- Is it possible for it to work with async code
- OOM during cargo mirai project analysis
- MacOS Mirai errors HOT 1
- Panic on `std::f64::<impl f64>::log2` HOT 1
- Compilation issues on older versions of crates
- modifying MIR in rustc_interface
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mirai.