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.
Paths
| Differential D76953
[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
Diff Detail
Unit TestsFailed Event Timelinesammccall added inline comments. This revision is now accepted and ready to land.Mar 27 2020, 2:33 PM Closed by commit rGf757ecbf8560: [AST] Fix a crash on invalid bitwidth exprs when preserving the recoveryexprs. (authored by hokein). · Explain WhyMar 30 2020, 2:08 AM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 253213 clang/lib/AST/ASTContext.cpp
clang/lib/AST/RecordLayoutBuilder.cpp
clang/lib/Sema/SemaDecl.cpp
clang/test/Sema/invalid-bitwidth-expr.cpp
clang/test/Sema/invalid-bitwidth-expr.mm
|
these numbers are arbitrary AFAICT, this seems fine.