This is an archive of the discontinued LLVM Phabricator instance.

[AST] Fix a null initializer crash for InitListExpr
ClosedPublic

Authored by hokein on Jun 2 2020, 12:00 AM.

Details

Summary

The Initializer of a InitListExpr can be reset to null, which leads to
nullptr-acces crashes.

Diff Detail

Event Timeline

hokein created this revision.Jun 2 2020, 12:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 2 2020, 12:00 AM
hokein marked an inline comment as done.Jun 2 2020, 12:06 AM
hokein added inline comments.
clang/lib/Sema/SemaInit.cpp
1640

I have the same question.

but if you looked at the other 2 places (same FIXME) of this file, they reset the Init only when the Result is valid. I think this place maybe an overlook.

sammccall accepted this revision.Jun 2 2020, 1:19 AM
This revision is now accepted and ready to land.Jun 2 2020, 1:19 AM
This revision was automatically updated to reflect the committed changes.