File tree Expand file tree Collapse file tree
cpp/ql/src/semmle/code/cpp/models/implementations Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -59,21 +59,27 @@ class Iterator extends Type {
5959
6060private predicate calledWithIteratorArgument ( Operator op , int index ) {
6161 exists ( Type t |
62- t = op .getACallToThisFunction ( ) .getArgument ( index ) .getUnspecifiedType ( )
63- |
64- t instanceof Iterator
65- or
66- t .( ReferenceType ) .getBaseType ( ) instanceof Iterator
62+ t =
63+ op
64+ .getACallToThisFunction ( )
65+ .getArgument ( index )
66+ .getExplicitlyConverted ( )
67+ .getType ( )
68+ .stripTopLevelSpecifiers ( )
69+ |
70+ t instanceof Iterator
71+ or
72+ t .( ReferenceType ) .getBaseType ( ) instanceof Iterator
6773 )
6874}
75+
6976/**
7077 * A non-member prefix `operator*` function for an iterator type.
7178 */
7279class IteratorPointerDereferenceOperator extends Operator , TaintFunction {
7380 IteratorPointerDereferenceOperator ( ) {
7481 this .hasName ( "operator*" ) and
75- this .getACallToThisFunction ( ) .getArgument ( 0 ) .getFullyConverted ( ) .getUnderlyingType ( ) instanceof
76- Iterator
82+ calledWithIteratorArgument ( this , 0 )
7783 }
7884
7985 override predicate hasTaintFlow ( FunctionInput input , FunctionOutput output ) {
You can’t perform that action at this time.
0 commit comments