This is an archive of the discontinued LLVM Phabricator instance.

[PR49761] Fix variadic arg handling in matcher
ClosedPublic

Authored by chrish_ericsson_atx on Apr 22 2021, 1:59 PM.

Details

Summary

Mishandling of variadic arguments in a function call caused a crash
(runtime assert fail) in bugprone-infinite-loop tidy checker. Fix
is to limit argument matching to the lesser of the number of variadic
params in the prototype or the number of actual args in the call.

Diff Detail

Event Timeline

chrish_ericsson_atx requested review of this revision.Apr 22 2021, 1:59 PM
chrish_ericsson_atx created this revision.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 22 2021, 1:59 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
aaron.ballman accepted this revision.Apr 23 2021, 9:31 AM

Thank you for the fix! LGTM with some minor nits.

clang/include/clang/ASTMatchers/ASTMatchers.h
4760–4765
This revision is now accepted and ready to land.Apr 23 2021, 9:31 AM
clang/include/clang/ASTMatchers/ASTMatchers.h
4760–4765

Thanks Aaron! Nice simplification. I don't know why I can't remember the variable name style -- old habits die hard! :) Thanks for the feedback.

Addressed feedback from aaron.ballman.

chrish_ericsson_atx marked an inline comment as done.Apr 23 2021, 10:04 AM
This revision was landed with ongoing or failed builds.Apr 23 2021, 10:07 AM
This revision was automatically updated to reflect the committed changes.