[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-02 Thread Warren Ristow via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. wristow marked an inline comment as done. Closed by commit rL293911: Prevent ICE in dllexport class with _Atomic data member (authored by wristow). Changed prior to commit:

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread John McCall via Phabricator via cfe-commits
rjmccall accepted this revision. rjmccall added a comment. This revision is now accepted and ready to land. Thanks, looks good. https://reviews.llvm.org/D29208 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread Warren Ristow via Phabricator via cfe-commits
wristow marked 2 inline comments as done. wristow added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1135 MemberExpr *ME2 = dyn_cast(RHS); -if (dyn_cast(ME2->getMemberDecl()) != Field) +if (!ME2 || dyn_cast(ME2->getMemberDecl()) != Field)

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread Warren Ristow via Phabricator via cfe-commits
wristow updated this revision to Diff 86767. wristow added a comment. Code restructured. https://reviews.llvm.org/D29208 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/atomic-dllexport.cpp Index: test/CodeGenCXX/atomic-dllexport.cpp

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread John McCall via Phabricator via cfe-commits
rjmccall added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1135 MemberExpr *ME2 = dyn_cast(RHS); -if (dyn_cast(ME2->getMemberDecl()) != Field) +if (!ME2 || dyn_cast(ME2->getMemberDecl()) != Field) return nullptr;

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread Warren Ristow via Phabricator via cfe-commits
wristow added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1135 MemberExpr *ME2 = dyn_cast(RHS); -if (dyn_cast(ME2->getMemberDecl()) != Field) +if (!ME2 || dyn_cast(ME2->getMemberDecl()) != Field) return nullptr;

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-02-01 Thread John McCall via Phabricator via cfe-commits
rjmccall requested changes to this revision. rjmccall added inline comments. This revision now requires changes to proceed. Comment at: lib/CodeGen/CGClass.cpp:1135 MemberExpr *ME2 = dyn_cast(RHS); -if (dyn_cast(ME2->getMemberDecl()) != Field) +if (!ME2

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-01-26 Thread Warren Ristow via Phabricator via cfe-commits
wristow added a comment. When a class that has been tagged as dllexport (for an MSVC target) contains an atomic data member via the C11 '_Atomic' approach, the front end crashes with a null pointer dereference. This patch fixes it by guarding the null dereference with the approach used by

[PATCH] D29208: Prevent ICE in dllexport class with _Atomic() data member

2017-01-26 Thread Warren Ristow via Phabricator via cfe-commits
wristow created this revision. Guard against a null pointer dereference that caused Clang to crash when processing a class containing an _Atomic() data member, and that is tagged with 'dllexport'. https://reviews.llvm.org/D29208 Files: lib/CodeGen/CGClass.cpp