-
Notifications
You must be signed in to change notification settings - Fork 277
Fix for getting values of pointers in traces in new SMT backend #6831
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 for getting values of pointers in traces in new SMT backend #6831
Conversation
^EXIT=10$ | ||
^SIGNAL=0$ | ||
-- | ||
-- |
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.
⛏️ Missing test description - "Test printing of NULL pointer values in trace."
@@ -44,7 +44,7 @@ class value_expr_from_smt_factoryt : public smt_term_const_downcast_visitort | |||
{ | |||
INVARIANT( | |||
pointer_type->get_width() == sort_width, | |||
"Width of smt bit vector term must match the width of pointer type."); | |||
"Width of smt bit vector term must match the width of pointer type."); |
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 change appears to have been squashed into the wrong commit.
rowt{ | ||
smt_bit_vector_constant_termt{12, 64}, | ||
constant_exprt( | ||
integer2bvrep(12, 64), pointer_typet(unsignedbv_typet(64), 64))}, |
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.
💡 It could be a bit tidier if these pointer tests were separated out into a macro like for the BIT_VECTOR_TESTS.
💡 These tests could be made more thorough by re-running them for 32 and 64 bit pointer widths.
💡 Using a pointer to a type such as bool_typet
or void_type()
instead of a pointer to unsignedbv_typet(64)
, may help improve the readability of the test by making all instances of the number 64
relate to the width of the pointer, rather than the width of the type the pointer points to.
} | ||
else | ||
{ | ||
// The reason we are mnually constructing a constant_exprt here is a |
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.
⛏️ Typo "mnually" should be "manually"
Codecov Report
@@ Coverage Diff @@
## develop #6831 +/- ##
===========================================
+ Coverage 77.01% 77.03% +0.01%
===========================================
Files 1594 1594
Lines 184954 185016 +62
===========================================
+ Hits 142438 142520 +82
+ Misses 42516 42496 -20
Continue to review full report at Codecov.
|
…ew SMT backend. The difference is that the previous test was effectively exercising NULL and any other pointer value (1, for instance) whereas this one specifically matches the decimal value of 0xDEADBEEF.
09cc397
to
691a3df
Compare
This PR changes the code that constructs bit vector terms from solver
values so that it now supports pointers.
This allows us to now see pointer values in traces in the new SMT backend.