From 01a556e583d2ffc1a930da120cd56f7662898b62 Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Mon, 14 Oct 2024 14:58:00 +0100 Subject: [PATCH] PS: Ensure the constants 0 .. 10 always exists. --- powershell/ql/lib/semmle/code/powershell/ConstantExpression.qll | 2 ++ 1 file changed, 2 insertions(+) diff --git a/powershell/ql/lib/semmle/code/powershell/ConstantExpression.qll b/powershell/ql/lib/semmle/code/powershell/ConstantExpression.qll index 11c9b3a4caf..bcf44fa2228 100644 --- a/powershell/ql/lib/semmle/code/powershell/ConstantExpression.qll +++ b/powershell/ql/lib/semmle/code/powershell/ConstantExpression.qll @@ -13,6 +13,8 @@ class ConstExpr extends @constant_expression, BaseConstExpr { private newtype TConstantValue = TConstInteger(int value) { exists(ConstExpr ce | ce.getType() = "Int32" and ce.getValue().getValue().toInt() = value) + or + value = [0 .. 10] // needed for `trackKnownValue` in `DataFlowPrivate` } or TConstDouble(float double) { exists(ConstExpr ce | ce.getType() = "Double" and ce.getValue().getValue().toFloat() = double)