-
Notifications
You must be signed in to change notification settings - Fork 6k
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
SMTChecker: Ignore errors that might occur during constant evaluation #15863
Conversation
cd282f8
to
7c3878c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some suggestions, but nothing critical. Overall looks good.
libsolidity/formal/SMTEncoder.cpp
Outdated
ErrorList l; | ||
ErrorReporter e(l); | ||
if (auto t = ConstantEvaluator::evaluate(e, _expr)) | ||
if (auto t = ConstantEvaluator::tryEvaluate(_expr)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have the helper, we should use it in StaticAnalyzer::visit(BinaryOperation)
as well. Though that needs a changelog entry and some tests so maybe it's better off done in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think this should be done in a separate PR.
f824f3b
to
cb5d6a5
Compare
cb5d6a5
to
74b9c33
Compare
Previously, if a fatal error would occur during constant evaluation in the model checker, it would throw an exception which the model checker would let escape and crash the compiler. We now use the new API that swallows any errors and the model checker can continue, simply treating the expression as not constant.
74b9c33
to
de36f55
Compare
Previously, if a fatal error would occur during constant evaluation in the model checker, it would throw an exception which the model checker would let escape and crash the compiler.
We introduce a new API to
ConstantEvaluator
that swallows any errors use it from the model checker.This allows model checker to continue, treating any expression where an error would occur simply as not constant.
Fixes #15600 #15601 #15722.
Resolves point 3 of @cameel 's analysis in #15709.