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