This is an archive of the discontinued LLVM Phabricator instance.

[Sema] Fix a use-after-free of a _Nonnull ParsedAttr
ClosedPublic

Authored by erik.pilkington on Mar 13 2019, 1:52 PM.

Details

Summary

We were allocating the implicit attribute in the declarator's attribute pool, but putting into the declaration specifier's ParsedAttributesView. If there are multiple declarators, then we'll use the attribute from the declaration specifier after clearing out the declarators attribute pool. Fix this by allocating the attribute in the declaration specifier's pool. This problem was creating some nonsensical diagnostics and crashes on the testcase (only in NDEBUG, though).

rdar://48529718

Thanks for taking a look!
Erik

Diff Detail

Repository
rL LLVM

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptMar 13 2019, 1:52 PM
This revision is now accepted and ready to land.Mar 14 2019, 5:54 AM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2019, 11:36 AM