@@ -16,7 +16,7 @@ predicate instanceofThisInCharPred(Class c, Type type) {
16
16
type = instanceOf .getType ( ) .getResolvedType ( )
17
17
) and
18
18
// no existing super-type corresponds to the instanceof type, that is benign.
19
- not c .getASuperType ( ) .getResolvedType ( ) = type
19
+ not c .getType ( ) .getASuperType + ( ) = type
20
20
}
21
21
22
22
/** Gets an inline cast that cases `this` to `type` inside a class predicate for `c`. */
@@ -29,7 +29,7 @@ InlineCast getAThisCast(Class c, Type type) {
29
29
)
30
30
}
31
31
32
- predicate usesFieldBasedInstanceof ( Class c , TypeExpr type , FieldDecl field , ComparisonFormula comp ) {
32
+ predicate usesFieldBasedInstanceof ( Class c , Type type , FieldDecl field , ComparisonFormula comp ) {
33
33
exists ( FieldAccess fieldAccess |
34
34
c .getCharPred ( ) .getBody ( ) = comp or
35
35
c .getCharPred ( ) .getBody ( ) .( Conjunction ) .getAnOperand ( ) = comp
@@ -39,8 +39,9 @@ predicate usesFieldBasedInstanceof(Class c, TypeExpr type, FieldDecl field, Comp
39
39
comp .getAnOperand ( ) instanceof ThisAccess and
40
40
comp .getAnOperand ( ) = fieldAccess and
41
41
fieldAccess .getDeclaration ( ) = field and
42
- field .getVarDecl ( ) .getTypeExpr ( ) = type
43
- )
42
+ field .getVarDecl ( ) .getType ( ) = type
43
+ ) and
44
+ not c .getType ( ) .getASuperType + ( ) = type
44
45
}
45
46
46
47
FieldAccess getARangeFieldAccess ( Class c , FieldDecl field , string name ) {
0 commit comments