Skip to content

Commit 83198f3

Browse files
committed
JS: Improve join orders related to getABooleanValue()
1 parent 997a11e commit 83198f3

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
@@ -57,6 +57,7 @@ class AbstractValue extends TAbstractValue {
5757
* Gets the Boolean value some concrete value represented by this
5858
* abstract value coerces to.
5959
*/
60+
pragma[nomagic]
6061
abstract boolean getBooleanValue();
6162

6263
/**

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)