Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ private module Input2 implements Impl::Private::InputSig2 {
exists(DataFlowCall call |
exists(ArgumentPosition pos |
sc = Impl::Private::SummaryComponent::argument(pos) and
pos.getArgument(call.asCallInstruction().getUnconvertedResultExpression()) = e
|
pos.getIndirectionIndex() = 0 and
result.(PostUpdateNode).getPreUpdateNode().asExpr() = e
or
result.(PostUpdateNode).getPreUpdateNode().asIndirectExpr(pos.getIndirectionIndex()) = e
pos.getArgument(call.asCallInstruction().getUnconvertedResultExpression()) = e and
result
.(PostUpdateNode)
.getPreUpdateNode()
.(ArgumentNode)
.sourceArgumentOf(call.asCallInstruction(), pos)
Comment on lines -278 to +283

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think I need some explanation as to why this works just as well.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We had the logic of sourceArgumentOf duplicated in FlowSummaryImpl. If the indirection index was 0 we picked the asExpr node, and otherwise we used the indirection index to get the indirect node. The same logic is implemented in the sourceArgumentOf predicate (where PrimaryArgumentNode implements the direct case, and SideEffectArgumentNode represents the indirect case).

)
or
exists(ReturnKind rk |
Expand Down
Loading