This is an archive of the discontinued LLVM Phabricator instance.

[AST] Fix a crash on invalid bitwidth exprs when preserving the recoveryexprs.
ClosedPublic

Authored by hokein on Mar 27 2020, 1:46 PM.

Details

Summary

If the bitwith expr contains errors, we mark the field decl invalid.

This patch also tweaks the behavior of ObjCInterfaceDecl to be consistent with
existing RecordDecl -- getObjCLayout method is only called with valid decls.

Diff Detail

Event Timeline

hokein created this revision.Mar 27 2020, 1:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 27 2020, 1:47 PM
sammccall accepted this revision.Mar 27 2020, 2:33 PM
sammccall added inline comments.
clang/lib/AST/ASTContext.cpp
2165

these numbers are arbitrary AFAICT, this seems fine.

clang/test/Sema/invalid-bitwidth-expr.mm
2

you might consider merging both tests into this file

This revision is now accepted and ready to land.Mar 27 2020, 2:33 PM
hokein updated this revision to Diff 253523.Mar 30 2020, 1:34 AM
hokein marked 2 inline comments as done.

address comments.

This revision was automatically updated to reflect the committed changes.