GeezerVison is showing github.com — C++: Address review comments · github/codeql@5f4fee0
File tree
Expand file treeCollapse file tree
Open diff view settings
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedFunction.qll +3-6Lines changed: 3 additions & 6 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -5,7 +5,6 @@ private import semmle.code.cpp.ir.internal.CppType |
5 | 5 | private import semmle.code.cpp.ir.internal.IRUtilities |
6 | 6 | private import semmle.code.cpp.ir.implementation.internal.OperandTag |
7 | 7 | private import semmle.code.cpp.ir.internal.TempVariableTag |
8 | | -private import semmle.code.cpp.models.interfaces.Throwing |
9 | 8 | private import InstructionTag |
10 | 9 | private import TranslatedElement |
11 | 10 | private import TranslatedExpr |
@@ -210,14 +209,12 @@ class TranslatedFunction extends TranslatedRootElement, TTranslatedFunction { |
210 | 209 | ( |
211 | 210 | // Only generate the `Unwind` instruction if there is any exception |
212 | 211 | // 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) |
216 | 213 | or |
217 | 214 | exists(ThrowExpr throw | throw.getEnclosingFunction() = func) |
218 | 215 | 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() |
221 | 218 | ) |
222 | 219 | ) |
223 | 220 | or |
|
Collapse file
Copy file name to clipboardExpand all lines: cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedStmt.qll +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -578,7 +578,7 @@ class TranslatedNoValueReturnStmt extends TranslatedReturnStmt, TranslatedVariab |
578 | 578 | /** |
579 | 579 | * A C/C++ `try` statement, or a `__try __except` or `__try __finally` statement. |
580 | 580 | */ |
581 | | -private class TryOrMicrosoftTryStmt extends Stmt { |
| 581 | +class TryOrMicrosoftTryStmt extends Stmt { |
582 | 582 | TryOrMicrosoftTryStmt() { |
583 | 583 | this instanceof TryStmt or |
584 | 584 | this instanceof MicrosoftTryStmt |
|