Skip to content

Commit ad80b36

Browse files
committed
C++: Don't generate parameter nodes for bodyless parameters when there is a summary of the enclosing function.
1 parent cda629b commit ad80b36

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowPrivate.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1011,7 +1011,7 @@ class CastNode extends Node {
10111011
}
10121012

10131013
cached
1014-
private newtype TDataFlowCallable =
1014+
newtype TDataFlowCallable =
10151015
TSourceCallable(Cpp::Declaration decl) {
10161016
not decl instanceof FlowSummaryImpl::Public::SummarizedCallable
10171017
} or

cpp/ql/lib/semmle/code/cpp/ir/dataflow/internal/DataFlowUtil.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ private newtype TIRDataFlowNode =
6666
TFinalGlobalValue(Ssa::GlobalUse globalUse) or
6767
TInitialGlobalValue(Ssa::GlobalDef globalUse) or
6868
TBodyLessParameterNodeImpl(Parameter p, int indirectionIndex) {
69+
not exists(TSummarizedCallable(p.getFunction())) and
6970
// Rule out parameters of catch blocks.
7071
not exists(p.getCatchBlock()) and
7172
// We subtract one because `getMaxIndirectionsForType` returns the maximum

cpp/ql/test/library-tests/dataflow/dataflow-tests/dataflow-ir-consistency.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ postWithInFlow
3232
| test.cpp:1077:10:1077:11 | swap output argument | PostUpdateNode should not be the target of local flow. |
3333
viableImplInCallContextTooLarge
3434
uniqueParameterNodeAtPosition
35-
| ../../../include/iterator.h:22:3:22:10 | iterator | *0 | ../../../include/iterator.h:22:3:22:10 | [summary param] *0 in iterator | Parameters with overlapping positions. |
36-
| ../../../include/iterator.h:22:3:22:10 | iterator | *0 | ../../../include/iterator.h:22:67:22:71 | *other | Parameters with overlapping positions. |
3735
uniqueParameterNodePosition
3836
uniqueContentApprox
3937
identityLocalStep

0 commit comments

Comments
 (0)