Comments (7)
There is a nuance after 1<<63ull: it does not fit the range of int64_t (as it is used in IntLiteralExpr).
So the only problem is constant unsigned long long values larger than that can fit in a signed long long.
I'd reopen this as a bug or create a new issue in Gazer, whichever is more appropriate :)
from gazer.
Gazer converts integer type (short, long, signed, unsigned, etc.) variables in the given C code to int in the generated CFA. Theta 1.7 handles these as large int literals, so the new functionality seems to work without any internal change in Gazer.
from gazer.
LLVM has some solution, I think. For example APInteger maybe, which stores bitwidth with the value.
Note: I would skip Boost, as it is only used on the outer layers, mostly for filesystem handling.
Without giving much thought, I think BMC is affected when using Integer representations (instead of the default(?) bitvectors).
Disclaimer: Both my claims against BMC and Theta modules are untested, I've only seen how IntLitExpr stores integers, which led me to think the problem exists. Further investigation may show otherwise.
I gladly take up the quest, if you'd like :) (both verifying and solving the issue)
from gazer.
@radl97 Indeed, we currently store large int literals in int64_t
. I think we can handle this either with llvm::APSInt
(like APInt
, but also stores sign information) or boost::multiprecision
. Both solutions are fine by me.
Note that you probably will have to update the expression hashing mechanism for int literals in GazerContextImpl.h
, otherwise you might get a good number of undebuggable template errors :) The default implementation for primitive literals uses llvm::hash_value
, probably we will need a specialization for llvm::hash_value
and/or expr_hasher
(if deciding equilitiy is not trivial).
from gazer.
Reopening seems cleaner to me in this case.
from gazer.
Thanks @radl97 for pointing this out. What could you imagine as a solution? Replacing Gazer's internal representation with some bigint (e.g. from boost)? Furthermore, is this also an issue for the BMC backend?
from gazer.
@radl97 if you feel like doing it, please go ahead. You can create a new branch and when you're done submit a PR. It would also be nice to come up with a simple test that fails currently, but will be fixed by the patch.
from gazer.
Related Issues (20)
- Jumping out of a loop from two different blocks to a same exit block breaks the translation of PHI values
- Basic format of the configuration description HOT 2
- Portfolio script as entry point of the docker file HOT 1
- Move CI to GH Actions
- Segmentation fault in a program with return in a nested loop
- Test harnesses should mock unused functions
- Support SV-COMP ReachSafety-Arrays with BMC HOT 1
- Support SV-COMP ReachSafety-Arrays with Theta
- Support SV-COMP ReachSafety-BitVectors with Theta
- Support SV-COMP ReachSafety-Floats with Theta
- Support SV-COMP ReachSafety-Heap with BMC HOT 2
- Support SV-COMP ReachSafety-Heap with Theta HOT 1
- Support SV-COMP ReachSafety-Sequentialized with BMC HOT 1
- Support SV-COMP ReachSafety-Sequentialized with Theta HOT 1
- Support SV-COMP ReachSafety-Combinations with Theta
- Support SV-COMP ReachSafety-Combined with BMC HOT 1
- Support 'malloc' in flat memory model
- Gitignore for portfolio HOT 3
- Test Docker image with GH Actions
- Discussion: Upgrading LLVM framework? HOT 5
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 gazer.