-
Notifications
You must be signed in to change notification settings - Fork 277
goto-symex: nil array size must not have a type added #5657
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
Conversation
@@ -263,6 +263,10 @@ bool check_renaming(const exprt &expr) | |||
if(to_ssa_expr(expr).get_original_expr().type() != type) | |||
return true; | |||
} | |||
else if(expr.id() == ID_nil) | |||
{ |
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.
Is that still needed after the change in goto_symex_state.cpp
?
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 is just the sanity check (when using --validate-ssa-equation
) - hopefully it never fails...
{ | ||
DATA_CHECK( | ||
vm, array_type.size() == nil_exprt{}, "array size must be an expression"); | ||
} |
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.
The message in that check could be clearer.
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.
How about the updated message?
Codecov Report
@@ Coverage Diff @@
## develop #5657 +/- ##
============================================
- Coverage 69.41% 32.26% -37.15%
============================================
Files 1243 985 -258
Lines 100612 83606 -17006
============================================
- Hits 69842 26978 -42864
- Misses 30770 56628 +25858
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
An expression has a type() member, which the nil irept lacks. Trying to access (in a non-const context) the type() member would thus create it, which in turn means that it no longer compares equal to a nil_exprt. As SSA renaming did access the type() member in such a way, the type of an array without specified size would no longer compare equal to the irept describing the type as generated by the C front-end, which in turn made simplification fail. The problem was surfaced by running cbmc --unwind 2 --pointer-check --bounds-check on c/ldv-linux-4.2-rc1/linux-4.2-rc1.tar.xz-32_7a-drivers--gpu--drm--i915--i915.ko-entry_point.cil.out.i from SV-COMP.
An expression has a type() member, which the nil irept lacks. Trying to
access (in a non-const context) the type() member would thus create it,
which in turn means that it no longer compares equal to a nil_exprt. As
SSA renaming did access the type() member in such a way, the type of an
array without specified size would no longer compare equal to the irept
describing the type as generated by the C front-end, which in turn made
simplification fail.
The problem was surfaced by running cbmc --unwind 2 --pointer-check
--bounds-check on
c/ldv-linux-4.2-rc1/linux-4.2-rc1.tar.xz-32_7a-drivers--gpu--drm--i915--i915.ko-entry_point.cil.out.i
from SV-COMP.