This is an archive of the discontinued LLVM Phabricator instance.

[-Wunsafe-buffer-usage] Fixits for assignment to array subscript expr
ClosedPublic

Authored by ziqingluo-90 on Jan 27 2023, 6:24 PM.

Details

Summary

Generalizing the shared "element-type" context means existing Fixables will emit Fix-Its for new cases.

Diff Detail

Event Timeline

jkorous created this revision.Jan 27 2023, 6:24 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 27 2023, 6:24 PM
jkorous requested review of this revision.Jan 27 2023, 6:24 PM
NoQ added a comment.Feb 6 2023, 3:53 PM

Looks great!

clang/lib/Analysis/UnsafeBufferUsage.cpp
133

I think anyOf is appropriate because the same expression cannot ever match both implicitCastExpr and binaryOperator at once, so we want this to short circuit.

ziqingluo-90 retitled this revision from [-Wunsafe-buffer-usage][WIP] Fixits for assignment to array subscript expr to [-Wunsafe-buffer-usage] Fixits for assignment to array subscript expr.Feb 21 2023, 2:25 PM
ziqingluo-90 commandeered this revision.Feb 21 2023, 2:52 PM
ziqingluo-90 edited reviewers, added: jkorous; removed: ziqingluo-90.

Taking care of this patch on behalf of @jkorous.

Addressing comments

NoQ accepted this revision.Feb 22 2023, 4:24 PM

Aha ok LGTM!

This revision is now accepted and ready to land.Feb 22 2023, 4:24 PM
This revision was landed with ongoing or failed builds.Feb 23 2023, 3:03 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2023, 3:03 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript