Fix replace_symbolt for non-lvalues#2200
Merged
tautschnig merged 1 commit intodiffblue:developfrom Sep 19, 2018
Merged
Conversation
5 tasks
Collaborator
|
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. |
Collaborator
Author
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:
|
Collaborator
Author
|
The unit test (first commit in here) has now been moved to #2724, I'll rebase once that's in. |
fad93bc to
e82eb7d
Compare
Collaborator
Author
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
Collaborator
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously only literal constants were considered non-lvalues, which is insufficient as the unit test shows.