@@ -52,25 +52,33 @@ module Input implements InputSig<DataFlowImplSpecific::CppDataFlow> {
5252
5353 bindingset [ token]
5454 ParameterPosition decodeUnknownParameterPosition ( AccessPath:: AccessPathTokenBase token ) {
55- // needed to support `Argument[x..y]` ranges and `Argument[-1]`
56- token .getName ( ) = "Argument" and
57- exists ( int pos | pos = AccessPath:: parseInt ( token .getAnArgument ( ) ) |
58- pos >= 0 and result = TDirectPosition ( pos )
59- or
60- // `Argument[-1]` is the qualifier object `*this`, not the `this` pointer itself
61- pos = - 1 and result = TIndirectionPosition ( pos , 1 )
55+ // needed to support `Argument[x..y]` ranges, `Argument[-1]`, and indirections `*Argument[0]`.
56+ exists ( int indirection |
57+ token .getName ( ) = indirectionString ( indirection ) + "Argument" and
58+ exists ( int pos | pos = AccessPath:: parseInt ( token .getAnArgument ( ) ) |
59+ pos >= 0 and indirection = 0 and result = TDirectPosition ( pos )
60+ or
61+ pos >= 0 and indirection > 0 and result = TIndirectionPosition ( pos , indirection )
62+ or
63+ // `Argument[-1]` is the qualifier object `*this`, not the `this` pointer itself
64+ pos = - 1 and result = TIndirectionPosition ( pos , indirection + 1 )
65+ )
6266 )
6367 }
6468
6569 bindingset [ token]
6670 ArgumentPosition decodeUnknownArgumentPosition ( AccessPath:: AccessPathTokenBase token ) {
67- // needed to support `Parameter[x..y]` ranges and `Parameter[-1]`
68- token .getName ( ) = "Parameter" and
69- exists ( int pos | pos = AccessPath:: parseInt ( token .getAnArgument ( ) ) |
70- pos >= 0 and result = TDirectPosition ( pos )
71- or
72- // `Argument[-1]` is the qualifier object `*this`, not the `this` pointer itself
73- pos = - 1 and result = TIndirectionPosition ( pos , 1 )
71+ // needed to support `Argument[x..y]` ranges, `Argument[-1]`, and indirections `*Argument[0]`.
72+ exists ( int indirection |
73+ token .getName ( ) = indirectionString ( indirection ) + "Parameter" and
74+ exists ( int pos | pos = AccessPath:: parseInt ( token .getAnArgument ( ) ) |
75+ pos >= 0 and indirection = 0 and result = TDirectPosition ( pos )
76+ or
77+ pos >= 0 and indirection > 0 and result = TIndirectionPosition ( pos , indirection )
78+ or
79+ // `Argument[-1]` is the qualifier object `*this`, not the `this` pointer itself
80+ pos = - 1 and result = TIndirectionPosition ( pos , indirection + 1 )
81+ )
7482 )
7583 }
7684}
0 commit comments