Skip to content

Commit 3a233cc

Browse files
committed
Reinstate bindingset[s] on parseAsBigInt
1 parent 544fcdd commit 3a233cc

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

cpp/ql/lib/semmle/code/cpp/rangeanalysis/RangeAnalysisUtils.qll

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -484,17 +484,16 @@ QlBuiltins::BigInt varMaxVal(Variable v) { result = typeUpperBound(v.getUnspecif
484484
*/
485485
QlBuiltins::BigInt infinityAsBigInt() { result = 1.toBigInt().bitShiftLeft(1024) }
486486

487+
bindingset[s]
487488
QlBuiltins::BigInt parseAsBigInt(string s) {
488-
exists(Expr e | s = e.getValue() |
489-
if exists(s.toBigInt()) then
490-
result = s.toBigInt()
491-
else
492-
exists(float f | f = s.toFloat() |
493-
f = 1.0 / 0.0 and result = infinityAsBigInt()
494-
or
495-
f = -(1.0 / 0.0) and result = -infinityAsBigInt()
496-
or
497-
result = f.toString().toBigInt()
498-
)
499-
)
489+
if exists(s.toBigInt()) then
490+
result = s.toBigInt()
491+
else
492+
exists(float f | f = s.toFloat() |
493+
f = 1.0 / 0.0 and result = infinityAsBigInt()
494+
or
495+
f = -(1.0 / 0.0) and result = -infinityAsBigInt()
496+
or
497+
result = f.toString().toBigInt()
498+
)
500499
}

0 commit comments

Comments
 (0)