From d23b128457c68f3c8069b0f47f836066bee98952 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Tue, 27 Sep 2022 12:31:58 +0200 Subject: [PATCH 1/2] delete unused code in an internal file --- .../dataflow/internal/CallableReturns.qll | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/CallableReturns.qll b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/CallableReturns.qll index 7b354e506b61..6adb1e376b05 100644 --- a/csharp/ql/lib/semmle/code/csharp/dataflow/internal/CallableReturns.qll +++ b/csharp/ql/lib/semmle/code/csharp/dataflow/internal/CallableReturns.qll @@ -31,29 +31,3 @@ predicate alwaysNotNullCallable(Callable c) { forex(Expr e | c.canReturn(e) | e instanceof NonNullExpr) ) } - -/** Holds if callable 'c' always throws an exception. */ -predicate alwaysThrowsCallable(Callable c) { - finalCallable(c) and - ( - forex(ControlFlow::Node pre | pre = c.getExitPoint().getAPredecessor() | - pre.getElement() instanceof ThrowElement - ) - or - exists(CIL::Method m | m.matchesHandle(c) | CR::alwaysThrowsMethod(m)) - ) -} - -/** Holds if callable `c` always throws exception `ex`. */ -predicate alwaysThrowsException(Callable c, Class ex) { - finalCallable(c) and - ( - forex(ControlFlow::Node pre | pre = c.getExitPoint().getAPredecessor() | - pre.getElement().(ThrowElement).getThrownExceptionType() = ex - ) - or - exists(CIL::Method m, CIL::Type t | m.matchesHandle(c) | - CR::alwaysThrowsException(m, t) and t.matchesHandle(ex) - ) - ) -} From ae6dd052497c15b62ac8ff550fbfb5a6bb230974 Mon Sep 17 00:00:00 2001 From: erik-krogh Date: Tue, 27 Sep 2022 12:40:05 +0200 Subject: [PATCH 2/2] deprecate unused class in query specific file --- .../csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/csharp/ql/lib/semmle/code/csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll b/csharp/ql/lib/semmle/code/csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll index af1979c2d6d5..b1bd83d143ca 100644 --- a/csharp/ql/lib/semmle/code/csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll +++ b/csharp/ql/lib/semmle/code/csharp/security/cryptography/EncryptionKeyDataFlowQuery.qll @@ -6,7 +6,7 @@ import csharp private import semmle.code.csharp.frameworks.system.security.cryptography.SymmetricAlgorithm /** Array of type Byte */ -class ByteArray extends ArrayType { +deprecated class ByteArray extends ArrayType { ByteArray() { getElementType() instanceof ByteType } }