mirror of
https://github.com/github/codeql.git
synced 2026-05-03 20:58:03 +02:00
C++: suppress destructor calls on delete in IR generation
This avoids an issue with duplicated qualifiers that was causing broken control flow
This commit is contained in:
@@ -116,6 +116,11 @@ private predicate ignoreExprOnly(Expr expr) {
|
||||
or
|
||||
not translateFunction(getEnclosingFunction(expr)) and
|
||||
not Raw::varHasIRFunc(getEnclosingVariable(expr))
|
||||
or
|
||||
exists(DeleteOrDeleteArrayExpr deleteExpr |
|
||||
// Ignore the destructor call, because the duplicated qualifier breaks control flow.
|
||||
deleteExpr.getDestructorCall() = expr
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -918,6 +923,7 @@ abstract class TranslatedElement extends TTranslatedElement {
|
||||
* holds.
|
||||
*/
|
||||
abstract Instruction getInstructionSuccessorInternal(InstructionTag tag, EdgeKind kind);
|
||||
|
||||
/**
|
||||
* Gets the successor instruction of the instruction that was generated by
|
||||
* this element for tag `tag`. The successor edge kind is specified by `kind`.
|
||||
|
||||
Reference in New Issue
Block a user