File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/dataflow Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,7 +118,11 @@ module DataFlow {
118118 predicate accessesGlobal ( string g ) { globalVarRef ( g ) .flowsTo ( this ) }
119119
120120 /** Holds if this node may evaluate to the string `s`, possibly through local data flow. */
121- predicate mayHaveStringValue ( string s ) { getAPredecessor ( ) .mayHaveStringValue ( s ) }
121+ predicate mayHaveStringValue ( string s ) {
122+ getAPredecessor ( ) .mayHaveStringValue ( s )
123+ or
124+ s = getStringValue ( )
125+ }
122126
123127 /** Gets the string value of this node, if it is a string literal or constant string concatenation. */
124128 string getStringValue ( ) { result = asExpr ( ) .getStringValue ( ) }
@@ -297,11 +301,6 @@ module DataFlow {
297301 /** Gets the expression or declaration this node corresponds to. */
298302 override AST:: ValueNode getAstNode ( ) { result = astNode }
299303
300- override predicate mayHaveStringValue ( string s ) {
301- Node .super .mayHaveStringValue ( s ) or
302- astNode .( ConstantString ) .getStringValue ( ) = s
303- }
304-
305304 override BasicBlock getBasicBlock ( ) { astNode = result .getANode ( ) }
306305
307306 override predicate hasLocationInfo (
You can’t perform that action at this time.
0 commit comments