Delaying deprecation of ThrowingFunction.

This commit is contained in:
REDMOND\brodes
2024-11-21 12:08:04 -05:00
parent 9b2590ec7a
commit 44126913cd
2 changed files with 4 additions and 11 deletions

View File

@@ -363,11 +363,11 @@ class TranslatedFunctionCall extends TranslatedCallExpr, TranslatedDirectCall {
}
final override predicate mayThrowException() {
expr.getTarget() instanceof AlwaysSehThrowingFunction
expr.getTarget().(ThrowingFunction).mayThrowException(_)
}
final override predicate mustThrowException() {
expr.getTarget() instanceof AlwaysSehThrowingFunction
expr.getTarget().(ThrowingFunction).mayThrowException(true)
}
}

View File

@@ -12,22 +12,15 @@ import semmle.code.cpp.models.interfaces.FunctionInputsAndOutputs
/**
* A function that is known to raise an exception.
*
* DEPRECATED: use `AlwaysSehThrowingFunction` instead if a function unconditionally throws.
* These are assumed the only case where functions throw/raise exceptions unconditionally.
* For functions that may throw, this will be the default behavior in the IR.
*/
abstract deprecated class ThrowingFunction extends Function {
abstract class ThrowingFunction extends Function {
ThrowingFunction() { any() }
/**
* Holds if this function may throw an exception during evaluation.
* If `unconditional` is `true` the function always throws an exception.
*
* DPERECATED: for always throwing functions use `AlwaysSehThrowingFunction` instead.
* For functions that may throw, this will be the default behavior in the IR.
*/
abstract deprecated predicate mayThrowException(boolean unconditional);
abstract predicate mayThrowException(boolean unconditional);
}
/**