@@ -173,7 +173,7 @@ module DataFlow {
173
173
}
174
174
175
175
/** Gets the file this data flow node comes from. */
176
- File getFile ( ) { hasLocationInfo ( result . getAbsolutePath ( ) , _ , _ , _ , _ ) }
176
+ File getFile ( ) { none ( ) } // overridden in subclasses
177
177
178
178
/** Gets the start line of this data flow node. */
179
179
int getStartLine ( ) { hasLocationInfo ( _, result , _, _, _) }
@@ -313,6 +313,8 @@ module DataFlow {
313
313
astNode .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
314
314
}
315
315
316
+ override File getFile ( ) { result = astNode .getFile ( ) }
317
+
316
318
override string toString ( ) { result = astNode .toString ( ) }
317
319
}
318
320
@@ -337,6 +339,8 @@ module DataFlow {
337
339
338
340
override string toString ( ) { result = ssa .getSourceVariable ( ) .getName ( ) }
339
341
342
+ override File getFile ( ) { result = ssa .getBasicBlock ( ) .getFile ( ) }
343
+
340
344
override ASTNode getAstNode ( ) { none ( ) }
341
345
}
342
346
@@ -361,6 +365,8 @@ module DataFlow {
361
365
362
366
override string toString ( ) { result = prop .( ASTNode ) .toString ( ) }
363
367
368
+ override File getFile ( ) { result = prop .( ASTNode ) .getFile ( ) }
369
+
364
370
override ASTNode getAstNode ( ) { result = prop }
365
371
}
366
372
@@ -384,6 +390,8 @@ module DataFlow {
384
390
385
391
override string toString ( ) { result = "..." + rest .toString ( ) }
386
392
393
+ override File getFile ( ) { result = pattern .getFile ( ) }
394
+
387
395
override ASTNode getAstNode ( ) { result = rest }
388
396
}
389
397
@@ -406,6 +414,8 @@ module DataFlow {
406
414
407
415
override string toString ( ) { result = pattern .toString ( ) }
408
416
417
+ override File getFile ( ) { result = pattern .getFile ( ) }
418
+
409
419
override ASTNode getAstNode ( ) { result = pattern }
410
420
}
411
421
@@ -429,6 +439,8 @@ module DataFlow {
429
439
430
440
override string toString ( ) { result = elt .toString ( ) }
431
441
442
+ override File getFile ( ) { result = pattern .getFile ( ) }
443
+
432
444
override ASTNode getAstNode ( ) { result = elt }
433
445
}
434
446
@@ -456,6 +468,8 @@ module DataFlow {
456
468
457
469
override string toString ( ) { result = elt .toString ( ) }
458
470
471
+ override File getFile ( ) { result = arr .getFile ( ) }
472
+
459
473
override ASTNode getAstNode ( ) { result = elt }
460
474
}
461
475
@@ -478,6 +492,8 @@ module DataFlow {
478
492
}
479
493
480
494
override string toString ( ) { result = "reflective call" }
495
+
496
+ override File getFile ( ) { result = call .getFile ( ) }
481
497
}
482
498
483
499
/**
@@ -497,6 +513,8 @@ module DataFlow {
497
513
}
498
514
499
515
override string toString ( ) { result = imprt .toString ( ) }
516
+
517
+ override File getFile ( ) { result = imprt .getFile ( ) }
500
518
}
501
519
502
520
/**
@@ -924,6 +942,8 @@ module DataFlow {
924
942
) {
925
943
p .getLocation ( ) .hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
926
944
}
945
+
946
+ override File getFile ( ) { result = p .getFile ( ) }
927
947
}
928
948
929
949
/**
@@ -944,6 +964,8 @@ module DataFlow {
944
964
945
965
/** Gets the attribute corresponding to this data flow node. */
946
966
HTML:: Attribute getAttribute ( ) { result = attr }
967
+
968
+ override File getFile ( ) { result = attr .getFile ( ) }
947
969
}
948
970
949
971
/**
@@ -968,6 +990,8 @@ module DataFlow {
968
990
* Gets the function corresponding to this exceptional return node.
969
991
*/
970
992
Function getFunction ( ) { result = function }
993
+
994
+ override File getFile ( ) { result = function .getFile ( ) }
971
995
}
972
996
973
997
/**
@@ -992,6 +1016,8 @@ module DataFlow {
992
1016
* Gets the invocation corresponding to this exceptional return node.
993
1017
*/
994
1018
DataFlow:: InvokeNode getInvocation ( ) { result = invoke .flow ( ) }
1019
+
1020
+ override File getFile ( ) { result = invoke .getFile ( ) }
995
1021
}
996
1022
997
1023
/**
@@ -1219,6 +1245,10 @@ module DataFlow {
1219
1245
.hasLocationInfo ( filepath , startline , startcolumn , endline , endcolumn )
1220
1246
)
1221
1247
}
1248
+
1249
+ override File getFile ( ) {
1250
+ exists ( StmtContainer container | this = TThisNode ( container ) | result = container .getFile ( ) )
1251
+ }
1222
1252
}
1223
1253
1224
1254
/**
0 commit comments