Skip to content

Commit 5f4fee0

Browse files
committed
C++: Address review comments
1 parent 500a2a0 commit 5f4fee0

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedFunction.qll

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ private import semmle.code.cpp.ir.internal.CppType
55
private import semmle.code.cpp.ir.internal.IRUtilities
66
private import semmle.code.cpp.ir.implementation.internal.OperandTag
77
private import semmle.code.cpp.ir.internal.TempVariableTag
8-
private import semmle.code.cpp.models.interfaces.Throwing
98
private import InstructionTag
109
private import TranslatedElement
1110
private import TranslatedExpr
@@ -210,14 +209,12 @@ class TranslatedFunction extends TranslatedRootElement, TTranslatedFunction {
210209
(
211210
// Only generate the `Unwind` instruction if there is any exception
212211
// handling present in the function.
213-
exists(TryStmt try | try.getEnclosingFunction() = func)
214-
or
215-
exists(MicrosoftTryStmt try | try.getEnclosingFunction() = func)
212+
exists(TryOrMicrosoftTryStmt try | try.getEnclosingFunction() = func)
216213
or
217214
exists(ThrowExpr throw | throw.getEnclosingFunction() = func)
218215
or
219-
exists(FunctionCall call | call.getTarget().(ThrowingFunction).mayThrowException(true) |
220-
call.getEnclosingFunction() = func
216+
exists(FunctionCall call | call.getEnclosingFunction() = func |
217+
getTranslatedExpr(call).(TranslatedCallExpr).mayThrowException()
221218
)
222219
)
223220
or

cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ class TranslatedNoValueReturnStmt extends TranslatedReturnStmt, TranslatedVariab
578578
/**
579579
* A C/C++ `try` statement, or a `__try __except` or `__try __finally` statement.
580580
*/
581-
private class TryOrMicrosoftTryStmt extends Stmt {
581+
class TryOrMicrosoftTryStmt extends Stmt {
582582
TryOrMicrosoftTryStmt() {
583583
this instanceof TryStmt or
584584
this instanceof MicrosoftTryStmt

0 commit comments

Comments
 (0)