Skip to content
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

C++: Fix toString on non-ExprNodes #16242

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

MathiasVP
Copy link
Contributor

The toString on dataflow nodes that are not ExprNodes hasn't gotten as much attention as the ones that are ExprNodes (i.e., the ones you can obtain by doing Node.asExpr() or Node.asIndirectExpr()). When we started showing some of these in path explanations in #16203 @jketema noticed that the toString was giving back implicitly and explicitly converted expressions.

This PR changes this by making sure that the toString on these nodes always use the unconverted expression when possible, and otherwise it falls back to the old behavior.

Note that this behavior changes only the toString and not which expressions are obtainable using Node.asExpr(). So it should be a very uncontroversial change that simply improves the presentation in path explanations.

@MathiasVP MathiasVP requested a review from a team as a code owner April 17, 2024 12:54
@github-actions github-actions bot added the C++ label Apr 17, 2024
@MathiasVP MathiasVP added the no-change-note-required This PR does not need a change note label Apr 17, 2024
@MathiasVP MathiasVP force-pushed the fix-tostring-on-nodes branch from c03e4eb to ba91973 Compare April 18, 2024 11:32
@MathiasVP MathiasVP force-pushed the fix-tostring-on-nodes branch from ba91973 to 58832a5 Compare April 18, 2024 11:33
@MathiasVP MathiasVP added the depends on internal PR This PR should only be merged in sync with an internal Semmle PR label Apr 18, 2024
Copy link
Contributor

@jketema jketema left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Does this need DCA?

@MathiasVP
Copy link
Contributor Author

Hm, yes I think so. I thought I had started one, but it looks like I didn't. I'll do that right away!

@MathiasVP MathiasVP merged commit a108fcd into github:main Apr 18, 2024
14 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ depends on internal PR This PR should only be merged in sync with an internal Semmle PR no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants