From 72266cb0004a09a67605c08048f97ad579cd4dfa Mon Sep 17 00:00:00 2001 From: Mathias Vorreiter Pedersen Date: Tue, 22 Apr 2025 15:00:49 +0100 Subject: [PATCH] PS: Drive-by cleanup in Constant.qll --- .../code/powershell/ast/internal/Constant.qll | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/powershell/ql/lib/semmle/code/powershell/ast/internal/Constant.qll b/powershell/ql/lib/semmle/code/powershell/ast/internal/Constant.qll index f39a9bdfff7..b68cc5f6e49 100644 --- a/powershell/ql/lib/semmle/code/powershell/ast/internal/Constant.qll +++ b/powershell/ql/lib/semmle/code/powershell/ast/internal/Constant.qll @@ -1,4 +1,5 @@ private import AstImport +private import codeql.util.Boolean private newtype TConstantValue = TConstInteger(int value) { @@ -12,15 +13,7 @@ private newtype TConstantValue = ) } or TConstString(string value) { exists(Raw::StringLiteral sl | sl.getValue() = value) } or - TConstBoolean(boolean value) { - exists(Raw::VarAccess va | - value = true and - va.getUserPath() = "true" - or - value = false and - va.getUserPath() = "false" - ) - } or + TConstBoolean(Boolean b) or TNull() /** A constant value. */ @@ -61,9 +54,7 @@ class ConstInteger extends ConstantValue, TConstInteger { final override string serialize() { result = this.getValue() } - final override ConstExpr getAnExpr() { - result.getValueString() = this.getValue() - } + final override ConstExpr getAnExpr() { result.getValueString() = this.getValue() } } /** A constant floating point value. */