@@ -69,8 +69,8 @@ abstract class RegexCreation extends DataFlow::Node {
69
69
abstract DataFlow:: Node getStringInput ( ) ;
70
70
71
71
/**
72
- * Gets a dataflow node for an options input that might contain parse mode
73
- * flags (if any).
72
+ * Gets a dataflow node for an options input that might contain options
73
+ * such as parse mode flags (if any).
74
74
*/
75
75
DataFlow:: Node getAnOptionsInput ( ) { none ( ) }
76
76
@@ -307,16 +307,26 @@ abstract class RegexEval extends CallExpr {
307
307
* Consider using `getARegex()` instead (which tracks the regular expression
308
308
* input back to its source).
309
309
*/
310
- abstract Expr getRegexInput ( ) ;
310
+ abstract DataFlow:: Node getRegexInputNode ( ) ;
311
+
312
+ /**
313
+ * DEPRECATED: Use `getRegexInputNode()` instead.
314
+ */
315
+ deprecated Expr getRegexInput ( ) { result = this .getRegexInputNode ( ) .asExpr ( ) }
311
316
312
317
/**
313
318
* Gets the input to this call that is the string the regular expression is evaluated on.
314
319
*/
315
- abstract Expr getStringInput ( ) ;
320
+ abstract DataFlow:: Node getStringInputNode ( ) ;
321
+
322
+ /**
323
+ * DEPRECATED: Use `getStringInputNode()` instead.
324
+ */
325
+ deprecated Expr getStringInput ( ) { result = this .getStringInputNode ( ) .asExpr ( ) }
316
326
317
327
/**
318
- * Gets a dataflow node for an options input that might contain parse mode
319
- * flags (if any).
328
+ * Gets a dataflow node for an options input that might contain options such
329
+ * as parse mode flags (if any).
320
330
*/
321
331
DataFlow:: Node getAnOptionsInput ( ) { none ( ) }
322
332
@@ -325,13 +335,12 @@ abstract class RegexEval extends CallExpr {
325
335
*/
326
336
RegExp getARegex ( ) {
327
337
// string literal used directly as a regex
328
- DataFlow:: exprNode ( result ) .( ParsedStringRegex ) .getAParse ( ) =
329
- DataFlow:: exprNode ( this .getRegexInput ( ) )
338
+ DataFlow:: exprNode ( result ) .( ParsedStringRegex ) .getAParse ( ) = this .getRegexInputNode ( )
330
339
or
331
340
// string literal -> regex object -> use
332
341
exists ( RegexCreation regexCreation |
333
342
DataFlow:: exprNode ( result ) .( ParsedStringRegex ) .getAParse ( ) = regexCreation .getStringInput ( ) and
334
- RegexUseFlow:: flow ( regexCreation , DataFlow :: exprNode ( this .getRegexInput ( ) ) )
343
+ RegexUseFlow:: flow ( regexCreation , this .getRegexInputNode ( ) )
335
344
)
336
345
}
337
346
@@ -345,7 +354,7 @@ abstract class RegexEval extends CallExpr {
345
354
any ( RegexAdditionalFlowStep s ) .setsParseMode ( setNode , result , true ) and
346
355
// reaches this eval
347
356
(
348
- RegexParseModeFlow:: flow ( setNode , DataFlow :: exprNode ( this .getRegexInput ( ) ) ) or
357
+ RegexParseModeFlow:: flow ( setNode , this .getRegexInputNode ( ) ) or
349
358
RegexParseModeFlow:: flow ( setNode , this .getAnOptionsInput ( ) )
350
359
)
351
360
)
@@ -404,9 +413,9 @@ private class AlwaysRegexEval extends RegexEval {
404
413
stringInput .asExpr ( ) = this .getQualifier ( )
405
414
}
406
415
407
- override Expr getRegexInput ( ) { result = regexInput . asExpr ( ) }
416
+ override DataFlow :: Node getRegexInputNode ( ) { result = regexInput }
408
417
409
- override Expr getStringInput ( ) { result = stringInput . asExpr ( ) }
418
+ override DataFlow :: Node getStringInputNode ( ) { result = stringInput }
410
419
}
411
420
412
421
/**
@@ -489,9 +498,9 @@ private class NSStringCompareOptionsRegexEval extends RegexEval {
489
498
NSStringCompareOptionsFlagFlow:: flow ( _, potentialEval .getAnOptionsInput ( ) )
490
499
}
491
500
492
- override Expr getRegexInput ( ) { result = potentialEval .getRegexInput ( ) . asExpr ( ) }
501
+ override DataFlow :: Node getRegexInputNode ( ) { result = potentialEval .getRegexInput ( ) }
493
502
494
- override Expr getStringInput ( ) { result = potentialEval .getStringInput ( ) . asExpr ( ) }
503
+ override DataFlow :: Node getStringInputNode ( ) { result = potentialEval .getStringInput ( ) }
495
504
496
505
override DataFlow:: Node getAnOptionsInput ( ) { result = potentialEval .getAnOptionsInput ( ) }
497
506
}
0 commit comments