-
Notifications
You must be signed in to change notification settings - Fork 273
Fix replace_symbolt for non-lvalues #2200
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
This requires something entirely different. This should not consider the "lvalue" case, i.e., replacing should always be done. If this is to be used on the lhs of an assignment, or the like, then some other function, say replace_expr_lvalue, or whatnot, should be defined. |
Ok, but that's been in the code base for a fair while and is not what this PR newly introduces. I'm happy to fix it though, if I could please get comments on two distinct cases:
|
The unit test (first commit in here) has now been moved to #2724, I'll rebase once that's in. |
fad93bc
to
e82eb7d
Compare
8c81f4f
to
8e15bbb
Compare
Literal constants are not the only ones: for example, address-of isn't an lvalue either. Make is_lvalue globally available to accomplish this.
8e15bbb
to
92fc16d
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.
Looks sensible
Previously only literal constants were considered non-lvalues, which is insufficient as the unit test shows.