Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-15 Thread NAKAMURA Takumi via cfe-commits
chapuni added a subscriber: chapuni. Comment at: lib/CodeGen/CGClass.cpp:1756 @@ +1755,3 @@ + class SanitizeDtorVTable final : public EHScopeStack::Cleanup { +const CXXDestructorDecl *Dtor; + It causes a warning in -Asserts. [-Wunused-private-field] http://r

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-15 Thread Evgeniy Stepanov via cfe-commits
eugenis accepted this revision. eugenis added a comment. This revision is now accepted and ready to land. LGTM http://reviews.llvm.org/D12712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-15 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34851. nmusgrave added a comment. - Remove commented-out block. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-derived-class.cpp test/CodeGenCXX/sanitize-dtor-vtable.cpp Index: test/CodeGenCXX/sanitize-d

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-15 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34822. nmusgrave added a comment. - Re-checking testing for poisoning vtable. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-derived-class.cpp test/CodeGenCXX/sanitize-dtor-vtable.cpp Index: test/CodeGen

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-11 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34617. nmusgrave added a comment. - Poison vtable in either complete or base dtor. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-derived-class.cpp test/CodeGenCXX/sanitize-dtor-vtable.cpp Index: test/Co

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-11 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34614. nmusgrave marked 2 inline comments as done. nmusgrave added a comment. - Fixed testing callback emission order to account for vptr. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-derived-class.cpp

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-10 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1652 @@ +1651,3 @@ + + static void Poison(CodeGenFunction &CGF, llvm::Value *OffsetPtr, +CharUnits::QuantityType PoisonSize); nmusgrave wrote: > eugenis wrote: > > If it's a glo

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-10 Thread Naomi Musgrave via cfe-commits
nmusgrave marked 2 inline comments as done. Comment at: lib/CodeGen/CGClass.cpp:1652 @@ +1651,3 @@ + + static void Poison(CodeGenFunction &CGF, llvm::Value *OffsetPtr, +CharUnits::QuantityType PoisonSize); eugenis wrote: > If it's a global func

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-10 Thread Evgeniy Stepanov via cfe-commits
eugenis added a comment. So, this can not be moved to the complete destructor because that would fail to poisons vptrs of the base classes. On the other hand, the current implementation is a bit wasteful, as it can poison the same pointer multiple times when it is shared by the derived class an

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-09 Thread Naomi Musgrave via cfe-commits
nmusgrave marked an inline comment as done. Comment at: lib/CodeGen/CGClass.cpp:1685 @@ -1680,3 +1684,3 @@ // Start sanitizing at this field if (startIndex < 0) startIndex = fieldIndex; compiler-rt/test/msan/dtor-multiple-inherit

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-09 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34373. nmusgrave added a comment. - Cleaned up impl. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitize-dtor-derived-class.cpp test/CodeGenCXX/sanitize-dtor-vtable.cpp Index: test/CodeGenCXX/sanitize-dtor-vtable.

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-09 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1685 @@ +1684,3 @@ +// function +Poison(CGF, VTablePtr, PoisonSize); + } Did you mean to move this chunk to the other cleanup class? Is there a test that would fail if vptr is

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-09 Thread Naomi Musgrave via cfe-commits
nmusgrave marked an inline comment as done. nmusgrave added a comment. http://reviews.llvm.org/D12712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-09 Thread Naomi Musgrave via cfe-commits
nmusgrave updated this revision to Diff 34357. nmusgrave added a comment. - Fixed testing callback emission order to account for vptr. Vptr poisoned after all virtual and member destructors are invoked, in order to prevent a data race an on the virtual function invoked by a class instance. (htt

Re: [PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-08 Thread Evgeniy Stepanov via cfe-commits
eugenis added inline comments. Comment at: lib/CodeGen/CGClass.cpp:1671 @@ -1670,1 +1670,3 @@ + ASTContext &Context = CGF.getContext(); + // Poison vtable and vtable ptr if they exist for this class. You are poisoning the vtable pointer in the base des

[PATCH] D12712: Implementation and testing for poisoning vtable ptr in dtor.

2015-09-08 Thread Naomi Musgrave via cfe-commits
nmusgrave created this revision. nmusgrave added reviewers: eugenis, kcc. nmusgrave added a subscriber: cfe-commits. After destruction, invocation of virtual functions prevented by poisoning vtable pointer. http://reviews.llvm.org/D12712 Files: lib/CodeGen/CGClass.cpp test/CodeGenCXX/sanitiz