This is an archive of the discontinued LLVM Phabricator instance.

[DeclPrinter] Fix two cases that crash clang -ast-print.
ClosedPublic

Authored by tra on Jan 5 2018, 3:08 PM.

Details

Summary

Both crashes are related to handling anonymous structures.

  • clang didn't handle () around an anonymous struct variable.
  • clang also crashed on syntax errors that could lead to other syntactic constructs following the declaration of an anonymous struct. While the code is invalid, that's not a good reason to panic compiler.

Diff Detail

Repository
rL LLVM

Event Timeline

tra created this revision.Jan 5 2018, 3:08 PM
tra added a reviewer: jlebar.Jan 8 2018, 3:34 PM
jlebar added a comment.Jan 8 2018, 4:15 PM

I strongly approve of fixing these crashes, but I don't think I can say with confidence whether this change is correct.

jlebar removed a reviewer: jlebar.Jan 8 2018, 4:15 PM
tra added a reviewer: bkramer.Jan 16 2018, 5:08 PM

@bkramer Can you take a look at the patch?

bkramer accepted this revision.Jan 17 2018, 3:10 AM

This should be fine.

This revision is now accepted and ready to land.Jan 17 2018, 3:10 AM
This revision was automatically updated to reflect the committed changes.