-
Notifications
You must be signed in to change notification settings - Fork 281
associate original expressions to tmp_post #6855
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
associate original expressions to tmp_post #6855
Conversation
This is not unproblematic. Remnants of these annotations might be very confusing, and it might be very confusing to read debug output. |
@@ -315,6 +317,7 @@ void goto_convertt::remove_post( | |||
{ | |||
exprt tmp = op; | |||
make_temp_symbol(tmp, "post", dest, mode); | |||
tmp.set(ID_tmp_post_origin, exprt(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.
Did the idea of setting pretty_name
of the symbol introduced by make_temp_symbol
not work?
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.
No. The pretty_name
of the symbol introduced by make_temp_symbol
is not printed in the report and the trace. They instead print from_expr(e)
where e
is the tmp_post
variable with type symbol_exprt
.
I think although we can add a special case into expr2c
to print pretty_name
, it suffers the same issue as Daniel pointed out. Printing tmp_post
as *ptr++
is very confusing that we cannot distinguish if it is the 'real' *ptr++
, or it is tmp_post
's pretty name.
Codecov Report
@@ Coverage Diff @@
## develop #6855 +/- ##
========================================
Coverage 77.79% 77.79%
========================================
Files 1567 1567
Lines 179707 179706 -1
========================================
+ Hits 139797 139806 +9
+ Misses 39910 39900 -10
Continue to review full report at Codecov.
|
Yes, printing
I endorse 1 or 4. |
This breaks
Merged via #6847, which I still think is a useful first step.
That seems feasible to me for it would not affect other code.
I'm worried that we are introducing an extra hoop. |
This PR is an alternative approach to address the problem introduced in #6847. Comparing to #6847, in this patch,
symbol_exprt
, are associate totmp_post
variables. The description of the violated property becomesdereference failure: pointer outside object bounds in *ptr++
from_expr_using_mode
will print the original expressions on tmp_post. So the assertion for the violated property becomesPOINTER_OFFSET(ptr++) >= 0l && OBJECT_SIZE(ptr++) >= (unsigned long int)POINTER_OFFSET(ptr++) + 4ul
Note that the original expression with side-effect is in the above predicate.
As am example, below is the result and the trace for the test
tmp_post_with_origin1
added in this PR.