-
Notifications
You must be signed in to change notification settings - Fork 274
Fix typecast in interpreter #3255
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
Fix typecast in interpreter #3255
Conversation
to_integer is deprecated and numeric_cast should be used instead.
evaluate(object_ref.get(), dest); | ||
return; | ||
} | ||
if(const auto i = numeric_cast<mp_integer>(object_ref)) |
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.
else if
for clarity this is exclusive with above
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: 8363450).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89941807
This makes the conditions in the `if` a bit simpler.
bd280e2
to
a6ca289
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: bd280e2).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89946706
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
The interpreter would fail to interpret expressions of type pointer which contained typecast. This fixes it by skiping the typecasts that are encountered.
a6ca289
to
be08937
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.
🚫
This PR failed Diffblue compatibility checks (cbmc commit: a6ca289).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89951404
Status will be re-evaluated on next push.
Please contact @peterschrammel, @thk123, or @allredj for support.
Common spurious failures:
- the cbmc commit has disappeared in the mean time (e.g. in a force-push)
- the author is not in the list of contributors (e.g. first-time contributors).
The incompatibility may have been introduced by an earlier PR. In that case merging this
PR should be avoided unless it fixes the current incompatibility.
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.
✔️
Passed Diffblue compatibility checks (cbmc commit: be08937).
Build URL: https://travis-ci.com/diffblue/test-gen/builds/89954908
After #3135 was merged, the interpreter started failing to interpret some expressions of type pointer, this was because they contained additional typecast.
This fixes the issue by making the interpreter look inside the typecast.
The reason I haven't added test here, is we have tests in another repository (which are failing at the moment), and I don't think the interpreter is much used in CBMC so it may be a bit difficult to test it here.