Skip to content

Commit afc027b

Browse files
committed
A15-2-2: Address cartesian product
Missing target call in DeletedExpr.
1 parent 1cc7e8b commit afc027b

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

cpp/autosar/src/rules/A15-2-2/ConstructorErrorLeavesObjectInInvalidState.ql

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,13 @@ class NewWrapperFunction extends Function {
5353

5454
/** An expression on which `delete` is called, directly or indirectly. */
5555
class DeletedExpr extends Expr {
56+
pragma[noinline, nomagic]
5657
DeletedExpr() {
57-
this = any(DeleteExpr deleteExpr).getExpr() or
58+
this = any(DeleteExpr deleteExpr).getExpr()
59+
or
5860
exists(DeleteWrapperFunction dwf, FunctionCall call |
59-
this = call.getArgument(dwf.getADeleteParameter().getIndex())
61+
this = call.getArgument(dwf.getADeleteParameter().getIndex()) and
62+
call.getTarget() = dwf
6063
)
6164
}
6265
}

0 commit comments

Comments
 (0)