Skip to content

Commit 47f4faa

Browse files
committed
use local dataflow instead of type-inference for mayHaveBooleanValue
1 parent ae56285 commit 47f4faa

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

javascript/ql/src/semmle/javascript/dataflow/DataFlow.qll

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ module DataFlow {
106106

107107
/** Holds if this node may evaluate to the Boolean value `b`. */
108108
predicate mayHaveBooleanValue(boolean b) {
109-
b = analyze().getAValue().(AbstractBoolean).getBooleanValue()
109+
getAPredecessor().mayHaveBooleanValue(b) // needed stage 31 + stage 26 + stage 22 (unfixable)
110+
or
111+
b = true and asExpr().(BooleanLiteral).getValue() = "true"
112+
or
113+
b = false and asExpr().(BooleanLiteral).getValue() = "false"
110114
}
111115

112116
/** Gets the integer value of this node, if it is an integer constant. */

0 commit comments

Comments
 (0)