-
Notifications
You must be signed in to change notification settings - Fork 1.8k
C++: No more flow into ReadSideEffect instructions #4393
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 PR should be good to go. The remaining changes are accepted in the internal PR. |
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Outdated
Show resolved
Hide resolved
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Outdated
Show resolved
Hide resolved
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Outdated
Show resolved
Hide resolved
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll
Outdated
Show resolved
Hide resolved
- ArgumentNode is now abstract - PrimaryArgumentNode is now an OperandNode. - ArgumentIndirectionNode is now merged into SideEffectArgumentNode.
| test.cpp:235:11:235:20 | (size_t)... | semmle.label | (size_t)... | | ||
| test.cpp:237:10:237:19 | (size_t)... | semmle.label | (size_t)... | | ||
| test.cpp:235:2:235:9 | Arg(0) | semmle.label | Arg(0) | | ||
| test.cpp:237:2:237:8 | Arg(0) | semmle.label | Arg(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.
These toString
s were not very pretty before, and they're not very pretty now. But at least now we have the ability to override their toString
in the future because we've separated the argument from the instruction that produces it.
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.
I just noticed this as well and pushed a better toString
. Originally, I had planned on adding this in a future PR, but I couldn't accept these ugly path explanations we got without a specialized toString
.
…ized toString on it
cpp/ql/src/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll
Outdated
Show resolved
Hide resolved
…e.qll Co-authored-by: Jonas Jensen <[email protected]>
#3123 (comment) pointed out its weird to have flow into
ReadSideEffectInstruction
as that instruction has no return value, and that it gives confusing path explanations.Now that we have operands as dataflow nodes we can avoid this rule and wire flow directly from the definition of the memory operand instead of going through the
ReadSideEffectInstruction
.CPP-difference shows no performance problems.