From 222c9f2db7aeb849297cfe57a3a76433e47ae905 Mon Sep 17 00:00:00 2001 From: "REDMOND\\brodes" Date: Thu, 24 Oct 2024 14:35:39 -0400 Subject: [PATCH] Style changes. --- .../implementation/raw/internal/TranslatedCall.qll | 4 ++-- .../implementations/StructuredExceptionHandling.qll | 10 +++++----- .../semmle/code/cpp/models/interfaces/Throwing.qll | 12 ++++++------ 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll index d03b753d8c43..4aebcad423fc 100644 --- a/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll +++ b/cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedCall.qll @@ -148,7 +148,7 @@ abstract class TranslatedCall extends TranslatedExpr { abstract predicate alwaysRaiseException(boolean isSeh); /** - * The call target is known to conditionally raise an exception. + * Holds when call target is known to conditionally raise an exception. * Note that `alwaysRaiseException`, `mayRaiseException`, * and `neverRaiseException` may conflict (e.g., all hold for a given target). * Conflicting results are resolved during IR generation. @@ -156,7 +156,7 @@ abstract class TranslatedCall extends TranslatedExpr { abstract predicate mayRaiseException(boolean isSeh); /** - * The call target is known to never raise an exception. + * Holds when the call target is known to never raise an exception. * Note that `alwaysRaiseException`, `mayRaiseException`, * and `neverRaiseException` may conflict (e.g., all hold for a given target). * Conflicting results are resolved during IR generation. diff --git a/cpp/ql/lib/semmle/code/cpp/models/implementations/StructuredExceptionHandling.qll b/cpp/ql/lib/semmle/code/cpp/models/implementations/StructuredExceptionHandling.qll index f455dd660852..d5941488d0d7 100644 --- a/cpp/ql/lib/semmle/code/cpp/models/implementations/StructuredExceptionHandling.qll +++ b/cpp/ql/lib/semmle/code/cpp/models/implementations/StructuredExceptionHandling.qll @@ -3,16 +3,16 @@ import semmle.code.cpp.models.interfaces.Throwing /** * The default behavior for Structured Exception Handling (SEH) is * any function may (conditionally) raise an exception. - * NOTE: this can be overriden by for any specific function to make in + * NOTE: this can be overridden by for any specific function to make in * unconditional or non-throwing. IR generation will enforce * the most strict interpretation. */ -class DefaultSEHExceptionBehavior extends ThrowingFunction { - DefaultSEHExceptionBehavior() { any() } +class DefaultSehExceptionBehavior extends ThrowingFunction { + DefaultSehExceptionBehavior() { any() } override predicate raisesException(boolean unconditional) { unconditional = false } - override TSEHException getExceptionType() { any() } + override TSehException getExceptionType() { any() } } class WindowsDriverExceptionAnnotation extends ThrowingFunction { @@ -22,5 +22,5 @@ class WindowsDriverExceptionAnnotation extends ThrowingFunction { override predicate raisesException(boolean unconditional) { unconditional = true } - override TSEHException getExceptionType() { any() } + override TSehException getExceptionType() { any() } } diff --git a/cpp/ql/lib/semmle/code/cpp/models/interfaces/Throwing.qll b/cpp/ql/lib/semmle/code/cpp/models/interfaces/Throwing.qll index e62ebb89da15..72db8c9e96c7 100644 --- a/cpp/ql/lib/semmle/code/cpp/models/interfaces/Throwing.qll +++ b/cpp/ql/lib/semmle/code/cpp/models/interfaces/Throwing.qll @@ -16,7 +16,7 @@ import semmle.code.cpp.models.interfaces.FunctionInputsAndOutputs */ newtype TException = /** Structured Exception Handling (SEH) exception */ - TSEHException() or + TSehException() or /** C++ exception */ TCxxException() @@ -40,7 +40,7 @@ abstract private class ExceptionAnnotation extends Function { /** * Holds if the exception type of this annotation is for a Structured Exception Handling (SEH) exception. */ - final predicate isSeh() { this.getExceptionType() = TSEHException() } + final predicate isSeh() { this.getExceptionType() = TSehException() } /** * Holds if the exception type of this annotation is for a CPP exception. @@ -49,19 +49,19 @@ abstract private class ExceptionAnnotation extends Function { } /** - * Functions that are known to not throw an exception. + * A Function that is known to not throw an exception. */ abstract class NonThrowingFunction extends ExceptionAnnotation { } /** - * Functions that are known to raise an exception. + * A function this is known to raise an exception. */ abstract class ThrowingFunction extends ExceptionAnnotation { - ThrowingFunction() { this instanceof Function } + ThrowingFunction() { any() } /** * Holds if this function may raise an exception during evaluation. - * If `conditional` is `false` the function may raise, and if `true` the function + * If `unconditional` is `false` the function may raise, and if `true` the function * will always raise an exception. * Do not specify `none()` if no exception is raised, instead use the * `NonThrowingFunction` class instead.