mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Address review comments
This commit is contained in:
@@ -5,7 +5,6 @@ private import semmle.code.cpp.ir.internal.CppType
|
||||
private import semmle.code.cpp.ir.internal.IRUtilities
|
||||
private import semmle.code.cpp.ir.implementation.internal.OperandTag
|
||||
private import semmle.code.cpp.ir.internal.TempVariableTag
|
||||
private import semmle.code.cpp.models.interfaces.Throwing
|
||||
private import InstructionTag
|
||||
private import TranslatedElement
|
||||
private import TranslatedExpr
|
||||
@@ -210,14 +209,12 @@ class TranslatedFunction extends TranslatedRootElement, TTranslatedFunction {
|
||||
(
|
||||
// Only generate the `Unwind` instruction if there is any exception
|
||||
// handling present in the function.
|
||||
exists(TryStmt try | try.getEnclosingFunction() = func)
|
||||
or
|
||||
exists(MicrosoftTryStmt try | try.getEnclosingFunction() = func)
|
||||
exists(TryOrMicrosoftTryStmt try | try.getEnclosingFunction() = func)
|
||||
or
|
||||
exists(ThrowExpr throw | throw.getEnclosingFunction() = func)
|
||||
or
|
||||
exists(FunctionCall call | call.getTarget().(ThrowingFunction).mayThrowException(true) |
|
||||
call.getEnclosingFunction() = func
|
||||
exists(FunctionCall call | call.getEnclosingFunction() = func |
|
||||
getTranslatedExpr(call).(TranslatedCallExpr).mayThrowException()
|
||||
)
|
||||
)
|
||||
or
|
||||
|
||||
@@ -578,7 +578,7 @@ class TranslatedNoValueReturnStmt extends TranslatedReturnStmt, TranslatedVariab
|
||||
/**
|
||||
* A C/C++ `try` statement, or a `__try __except` or `__try __finally` statement.
|
||||
*/
|
||||
private class TryOrMicrosoftTryStmt extends Stmt {
|
||||
class TryOrMicrosoftTryStmt extends Stmt {
|
||||
TryOrMicrosoftTryStmt() {
|
||||
this instanceof TryStmt or
|
||||
this instanceof MicrosoftTryStmt
|
||||
|
||||
Reference in New Issue
Block a user