Skip to content

Commit d349ae0

Browse files
Merge pull request #8099 from jkorous-apple/cxx-safe-buffers/integrate/fix-nonptr-assign-to-matcher
[-Wunsafe-buffer-usage] Fix AST matcher of UUCAddAssignGadget
2 parents 450848d + 918fa9d commit d349ae0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

clang/lib/Analysis/UnsafeBufferUsage.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,11 +1185,16 @@ class UUCAddAssignGadget : public FixableGadget {
11851185
}
11861186

11871187
static Matcher matcher() {
1188+
// clang-format off
11881189
return stmt(isInUnspecifiedUntypedContext(expr(ignoringImpCasts(
11891190
binaryOperator(hasOperatorName("+="),
1190-
hasLHS(declRefExpr(toSupportedVariable())),
1191+
hasLHS(
1192+
declRefExpr(
1193+
hasPointerType(),
1194+
toSupportedVariable())),
11911195
hasRHS(expr().bind(OffsetTag)))
11921196
.bind(UUCAddAssignTag)))));
1197+
// clang-format on
11931198
}
11941199

11951200
virtual std::optional<FixItList> getFixits(const Strategy &S) const override;

0 commit comments

Comments
 (0)