File tree Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Expand file tree Collapse file tree 2 files changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -254,10 +254,9 @@ module API {
254
254
*/
255
255
pragma [ nomagic]
256
256
private predicate useRoot ( string lbl , DataFlow:: Node ref ) {
257
- exists ( string name , ExprNodes:: ConstantAccessCfgNode access , ConstantReadAccess read |
258
- access = ref .asExpr ( ) and
259
- lbl = Label:: member ( read .getName ( ) ) and
260
- read = access .getExpr ( )
257
+ exists ( string name , ConstantReadAccess read |
258
+ read = ref .asExpr ( ) .getExpr ( ) and
259
+ lbl = Label:: member ( read .getName ( ) )
261
260
|
262
261
name = resolveTopLevel ( read )
263
262
or
@@ -389,6 +388,17 @@ module API {
389
388
useStep ( lbl , node , ref )
390
389
)
391
390
)
391
+ or
392
+ // `pred` is a use of class A
393
+ // `succ` is a use of class B
394
+ // there exists a class declaration B < A
395
+ exists ( ClassDeclaration c , DataFlow:: Node a , DataFlow:: Node b |
396
+ use ( pred , a ) and
397
+ use ( succ , b ) and
398
+ resolveConstant ( b .asExpr ( ) .getExpr ( ) ) = resolveConstantWriteAccess ( c ) and
399
+ c .getSuperclassExpr ( ) = a .asExpr ( ) .getExpr ( ) and
400
+ lbl = Label:: subclass ( )
401
+ )
392
402
}
393
403
394
404
/**
Original file line number Diff line number Diff line change @@ -233,12 +233,17 @@ private module ResolveImpl {
233
233
234
234
pragma [ nomagic]
235
235
private string resolveConstantReadAccessNonRec ( ConstantReadAccess c , int priority ) {
236
+ // ::B
236
237
c .hasGlobalScope ( ) and result = c .getName ( ) and priority = 0
237
238
or
239
+ // A::B
238
240
exists ( string name , string s | result = isDefinedConstantNonRec ( s , name ) |
239
241
s = resolveConstantReadAccessScopeNonRec ( c , priority , name )
240
242
)
241
243
or
244
+ // module A
245
+ // B
246
+ // end
242
247
exists ( string name |
243
248
exists ( Namespace n , string qname |
244
249
n = constantReadAccessEnclosingNameSpace ( c , priority , name ) and
You can’t perform that action at this time.
0 commit comments