File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
javascript/ql/src/semmle/javascript/dataflow Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -118,7 +118,11 @@ module DataFlow {
118
118
predicate accessesGlobal ( string g ) { globalVarRef ( g ) .flowsTo ( this ) }
119
119
120
120
/** 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
+ }
122
126
123
127
/** Gets the string value of this node, if it is a string literal or constant string concatenation. */
124
128
string getStringValue ( ) { result = asExpr ( ) .getStringValue ( ) }
@@ -297,11 +301,6 @@ module DataFlow {
297
301
/** Gets the expression or declaration this node corresponds to. */
298
302
override AST:: ValueNode getAstNode ( ) { result = astNode }
299
303
300
- override predicate mayHaveStringValue ( string s ) {
301
- Node .super .mayHaveStringValue ( s ) or
302
- astNode .( ConstantString ) .getStringValue ( ) = s
303
- }
304
-
305
304
override BasicBlock getBasicBlock ( ) { astNode = result .getANode ( ) }
306
305
307
306
override predicate hasLocationInfo (
You can’t perform that action at this time.
0 commit comments