Skip to content

Commit

Permalink
Style changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrodes committed Oct 24, 2024
1 parent 3f01e4d commit 222c9f2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ 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.
*/
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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -22,5 +22,5 @@ class WindowsDriverExceptionAnnotation extends ThrowingFunction {

override predicate raisesException(boolean unconditional) { unconditional = true }

override TSEHException getExceptionType() { any() }
override TSehException getExceptionType() { any() }
}
12 changes: 6 additions & 6 deletions cpp/ql/lib/semmle/code/cpp/models/interfaces/Throwing.qll
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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.
Expand All @@ -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.
Expand Down

0 comments on commit 222c9f2

Please sign in to comment.