Skip to content

Commit 5d28d57

Browse files
committed
JS: Improve join orders related to getABooleanValue()
1 parent a2e3c50 commit 5d28d57

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

javascript/ql/lib/semmle/javascript/dataflow/AbstractValues.qll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ class AbstractValue extends TAbstractValue {
5959
* Gets the Boolean value some concrete value represented by this
6060
* abstract value coerces to.
6161
*/
62+
pragma[nomagic]
6263
abstract boolean getBooleanValue();
6364

6465
/**

javascript/ql/lib/semmle/javascript/dataflow/TypeInference.qll

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,15 @@ class AnalyzedNode extends DataFlow::Node {
9292
PrimitiveType getAPrimitiveType() { result = this.getAValue().toPrimitive().getType() }
9393

9494
/** Gets a Boolean value that this node evaluates to. */
95+
bindingset[this]
96+
overlay[caller?]
97+
pragma[inline_late]
9598
boolean getABooleanValue() { result = this.getAValue().getBooleanValue() }
9699

97100
/** Gets the unique Boolean value that this node evaluates to, if any. */
98-
boolean getTheBooleanValue() { forex(boolean bv | bv = this.getABooleanValue() | result = bv) }
101+
overlay[caller?]
102+
pragma[inline]
103+
boolean getTheBooleanValue() { result = unique( | | this.getABooleanValue()) }
99104

100105
/** Gets the unique type inferred for this node, if any. */
101106
InferredType getTheType() { result = unique(InferredType t | t = this.getAType()) }

0 commit comments

Comments
 (0)