Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a756f14

Browse files
committed
C++: Only report implicit destructors if we need to translate them.
1 parent d4e2d37 commit a756f14

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,17 @@ abstract class TranslatedExpr extends TranslatedElement {
9292
or
9393
exists(int maxChildId, int destructorIndex |
9494
maxChildId = max(int childId | exists(this.getChildInternal(childId))) and
95-
result.(TranslatedExpr).getExpr() = expr.getImplicitDestructorCall(destructorIndex) and
95+
result = this.getImplicitDestructorCall(destructorIndex) and
9696
id = maxChildId + 1 + destructorIndex
9797
)
9898
}
9999

100+
final private TranslatedExpr getImplicitDestructorCall(int index) {
101+
result.getExpr() = expr.getImplicitDestructorCall(index)
102+
}
103+
100104
final override predicate hasAnImplicitDestructorCall() {
101-
exists(expr.getAnImplicitDestructorCall())
105+
exists(this.getImplicitDestructorCall(_))
102106
}
103107

104108
final override int getFirstDestructorCallIndex() {

0 commit comments

Comments
 (0)