Skip to content

Commit 81375fa

Browse files
committed
Fix missing check for qualifiers on members returning subobject refs
1 parent f4a39b4 commit 81375fa

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

cpp/misra/src/rules/RULE-6-8-4/MemberFunctionsRefqualified.ql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class MembersReturningSubObject extends MembersReturningObjectOrSubobject {
5252
MembersReturningSubObject() {
5353
exists(ReturnStmt r, FieldAccess access, Expr e |
5454
r.getEnclosingFunction() = this and
55+
(not exists(access.getQualifier()) or access.getQualifier() instanceof ThisExpr) and
5556
(
5657
//subobject returned by address
5758
r.getAChild() = access.getParent() and

0 commit comments

Comments
 (0)