@@ -86,10 +86,12 @@ int getMaxIndirectionsForType(Type type) {
8686 result = countIndirectionsForCppType ( getTypeForGLValue ( type ) )
8787}
8888
89- private class PointerOrReferenceType extends Cpp:: DerivedType {
90- PointerOrReferenceType ( ) {
89+ private class PointerOrArrayOrReferenceType extends Cpp:: DerivedType {
90+ PointerOrArrayOrReferenceType ( ) {
9191 this instanceof Cpp:: PointerType
9292 or
93+ this instanceof Cpp:: ArrayType
94+ or
9395 this instanceof Cpp:: ReferenceType
9496 }
9597}
@@ -180,8 +182,10 @@ abstract class Indirection extends Type {
180182 predicate isAdditionalConversionFlow ( Operand opFrom , Instruction instrTo ) { none ( ) }
181183}
182184
183- private class PointerOrReferenceTypeIndirection extends Indirection instanceof PointerOrReferenceType {
184- PointerOrReferenceTypeIndirection ( ) { baseType = PointerOrReferenceType .super .getBaseType ( ) }
185+ private class PointerOrArrayOrReferenceTypeIndirection extends Indirection instanceof PointerOrArrayOrReferenceType {
186+ PointerOrArrayOrReferenceTypeIndirection ( ) {
187+ baseType = PointerOrArrayOrReferenceType .super .getBaseType ( )
188+ }
185189
186190 override int getNumberOfIndirections ( ) {
187191 result = 1 + countIndirections ( this .getBaseType ( ) .getUnspecifiedType ( ) )
@@ -211,7 +215,8 @@ private module IteratorIndirections {
211215
212216 class IteratorIndirection extends Indirection instanceof Interfaces:: Iterator {
213217 IteratorIndirection ( ) {
214- not this instanceof PointerOrReferenceTypeIndirection and baseType = super .getValueType ( )
218+ not this instanceof PointerOrArrayOrReferenceTypeIndirection and
219+ baseType = super .getValueType ( )
215220 }
216221
217222 override int getNumberOfIndirections ( ) {
@@ -399,7 +404,7 @@ predicate isModifiableByCall(ArgumentOperand operand, int indirectionIndex) {
399404 // by `call` should not be of the form `const T*` (for some deeply const type `T`).
400405 if call .getStaticCallTarget ( ) instanceof Cpp:: ConstMemberFunction
401406 then
402- exists ( PointerOrReferenceType resultType |
407+ exists ( PointerOrArrayOrReferenceType resultType |
403408 resultType = call .getResultType ( ) and
404409 not resultType .isDeeplyConstBelow ( )
405410 )
@@ -420,10 +425,7 @@ private predicate isModifiableAtImpl(CppType cppType, int indirectionIndex) {
420425 (
421426 exists ( Type pointerType , Type base , Type t |
422427 pointerType = t .getUnderlyingType ( ) and
423- (
424- pointerType = any ( Indirection ind ) .getUnderlyingType ( ) or
425- pointerType instanceof Cpp:: ArrayType
426- ) and
428+ pointerType = any ( Indirection ind ) .getUnderlyingType ( ) and
427429 cppType .hasType ( t , _) and
428430 base = getTypeImpl ( pointerType , indirectionIndex )
429431 |
0 commit comments