C++: Don't generate parameter nodes for bodyless parameters when there is a summary of the enclosing function.

This commit is contained in:
Mathias Vorreiter Pedersen
2025-01-24 20:16:04 +00:00
parent cda629b204
commit ad80b36074
3 changed files with 2 additions and 3 deletions

View File

@@ -1011,7 +1011,7 @@ class CastNode extends Node {
}
cached
private newtype TDataFlowCallable =
newtype TDataFlowCallable =
TSourceCallable(Cpp::Declaration decl) {
not decl instanceof FlowSummaryImpl::Public::SummarizedCallable
} or

View File

@@ -66,6 +66,7 @@ private newtype TIRDataFlowNode =
TFinalGlobalValue(Ssa::GlobalUse globalUse) or
TInitialGlobalValue(Ssa::GlobalDef globalUse) or
TBodyLessParameterNodeImpl(Parameter p, int indirectionIndex) {
not exists(TSummarizedCallable(p.getFunction())) and
// Rule out parameters of catch blocks.
not exists(p.getCatchBlock()) and
// We subtract one because `getMaxIndirectionsForType` returns the maximum

View File

@@ -32,8 +32,6 @@ postWithInFlow
| test.cpp:1077:10:1077:11 | swap output argument | PostUpdateNode should not be the target of local flow. |
viableImplInCallContextTooLarge
uniqueParameterNodeAtPosition
| ../../../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. |
| ../../../include/iterator.h:22:3:22:10 | iterator | *0 | ../../../include/iterator.h:22:67:22:71 | *other | Parameters with overlapping positions. |
uniqueParameterNodePosition
uniqueContentApprox
identityLocalStep