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:
https://reviews.llvm.org/D29208?vs=86767&id=8684
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
http://lists.llvm.org/cgi-bin/mai
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)
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
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;
wrist
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;
rjmcca
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 |
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
simil
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
test/CodeGenCXX/atomic-dllexpor