@@ -69,8 +69,8 @@ abstract class RegexCreation extends DataFlow::Node {
6969 abstract DataFlow:: Node getStringInput ( ) ;
7070
7171 /**
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).
7474 */
7575 DataFlow:: Node getAnOptionsInput ( ) { none ( ) }
7676
@@ -307,16 +307,26 @@ abstract class RegexEval extends CallExpr {
307307 * Consider using `getARegex()` instead (which tracks the regular expression
308308 * input back to its source).
309309 */
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 ( ) }
311316
312317 /**
313318 * Gets the input to this call that is the string the regular expression is evaluated on.
314319 */
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 ( ) }
316326
317327 /**
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).
320330 */
321331 DataFlow:: Node getAnOptionsInput ( ) { none ( ) }
322332
@@ -325,13 +335,12 @@ abstract class RegexEval extends CallExpr {
325335 */
326336 RegExp getARegex ( ) {
327337 // 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 ( )
330339 or
331340 // string literal -> regex object -> use
332341 exists ( RegexCreation regexCreation |
333342 DataFlow:: exprNode ( result ) .( ParsedStringRegex ) .getAParse ( ) = regexCreation .getStringInput ( ) and
334- RegexUseFlow:: flow ( regexCreation , DataFlow :: exprNode ( this .getRegexInput ( ) ) )
343+ RegexUseFlow:: flow ( regexCreation , this .getRegexInputNode ( ) )
335344 )
336345 }
337346
@@ -345,7 +354,7 @@ abstract class RegexEval extends CallExpr {
345354 any ( RegexAdditionalFlowStep s ) .setsParseMode ( setNode , result , true ) and
346355 // reaches this eval
347356 (
348- RegexParseModeFlow:: flow ( setNode , DataFlow :: exprNode ( this .getRegexInput ( ) ) ) or
357+ RegexParseModeFlow:: flow ( setNode , this .getRegexInputNode ( ) ) or
349358 RegexParseModeFlow:: flow ( setNode , this .getAnOptionsInput ( ) )
350359 )
351360 )
@@ -404,9 +413,9 @@ private class AlwaysRegexEval extends RegexEval {
404413 stringInput .asExpr ( ) = this .getQualifier ( )
405414 }
406415
407- override Expr getRegexInput ( ) { result = regexInput . asExpr ( ) }
416+ override DataFlow :: Node getRegexInputNode ( ) { result = regexInput }
408417
409- override Expr getStringInput ( ) { result = stringInput . asExpr ( ) }
418+ override DataFlow :: Node getStringInputNode ( ) { result = stringInput }
410419}
411420
412421/**
@@ -489,9 +498,9 @@ private class NSStringCompareOptionsRegexEval extends RegexEval {
489498 NSStringCompareOptionsFlagFlow:: flow ( _, potentialEval .getAnOptionsInput ( ) )
490499 }
491500
492- override Expr getRegexInput ( ) { result = potentialEval .getRegexInput ( ) . asExpr ( ) }
501+ override DataFlow :: Node getRegexInputNode ( ) { result = potentialEval .getRegexInput ( ) }
493502
494- override Expr getStringInput ( ) { result = potentialEval .getStringInput ( ) . asExpr ( ) }
503+ override DataFlow :: Node getStringInputNode ( ) { result = potentialEval .getStringInput ( ) }
495504
496505 override DataFlow:: Node getAnOptionsInput ( ) { result = potentialEval .getAnOptionsInput ( ) }
497506}
0 commit comments