@@ -1821,31 +1821,41 @@ class SummaryParameterNode extends AbstractParameterNode, FlowSummaryNode {
1821
1821
}
1822
1822
}
1823
1823
1824
- pragma [ noinline]
1825
- private predicate indirectPositionHasArgumentIndexAndIndex (
1826
- IndirectionPosition pos , int argumentIndex , int indirectionIndex
1827
- ) {
1828
- pos .getArgumentIndex ( ) = argumentIndex and
1829
- pos .getIndirectionIndex ( ) = indirectionIndex
1830
- }
1824
+ private class DirectBodyLessParameterNode extends AbstractExplicitParameterNode ,
1825
+ BodyLessParameterNodeImpl
1826
+ {
1827
+ DirectBodyLessParameterNode ( ) { indirectionIndex = 0 }
1831
1828
1832
- pragma [ noinline]
1833
- private predicate indirectParameterNodeHasArgumentIndexAndIndex (
1834
- IndirectParameterNode node , int argumentIndex , int indirectionIndex
1835
- ) {
1836
- node .hasInstructionAndIndirectionIndex ( _, indirectionIndex ) and
1837
- node .getArgumentIndex ( ) = argumentIndex
1829
+ override predicate isParameterOf ( DataFlowCallable f , ParameterPosition pos ) {
1830
+ exists ( Function func |
1831
+ this .getFunction ( ) = func and
1832
+ f .asSourceCallable ( ) = func and
1833
+ func .getParameter ( pos .( DirectPosition ) .getIndex ( ) ) = p
1834
+ )
1835
+ }
1836
+
1837
+ override Parameter getParameter ( ) { result = p }
1838
1838
}
1839
1839
1840
- /** A synthetic parameter to model the pointed-to object of a pointer parameter. */
1841
- class ParameterIndirectionNode extends ParameterNode instanceof IndirectParameterNode {
1840
+ private class IndirectBodyLessParameterNode extends AbstractIndirectParameterNode ,
1841
+ BodyLessParameterNodeImpl
1842
+ {
1843
+ IndirectBodyLessParameterNode ( ) { not this instanceof DirectBodyLessParameterNode }
1844
+
1842
1845
override predicate isParameterOf ( DataFlowCallable f , ParameterPosition pos ) {
1843
- IndirectParameterNode .super .getEnclosingCallable ( ) = f .getUnderlyingCallable ( ) and
1844
- exists ( int argumentIndex , int indirectionIndex |
1845
- indirectPositionHasArgumentIndexAndIndex ( pos , argumentIndex , indirectionIndex ) and
1846
- indirectParameterNodeHasArgumentIndexAndIndex ( this , argumentIndex , indirectionIndex )
1846
+ exists ( Function func , int argumentPosition |
1847
+ this .getFunction ( ) = func and
1848
+ f .asSourceCallable ( ) = func and
1849
+ indirectPositionHasArgumentIndexAndIndex ( pos , argumentPosition , indirectionIndex ) and
1850
+ func .getParameter ( argumentPosition ) = p
1847
1851
)
1848
1852
}
1853
+
1854
+ override int getIndirectionIndex ( ) {
1855
+ result = BodyLessParameterNodeImpl .super .getIndirectionIndex ( )
1856
+ }
1857
+
1858
+ override Parameter getParameter ( ) { result = p }
1849
1859
}
1850
1860
1851
1861
/**
0 commit comments