nmusgrave updated this revision to Diff 33982.
nmusgrave marked 2 inline comments as done.
nmusgrave added a comment.
- Clean method headers, style.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-d
rsmith accepted this revision.
rsmith added a comment.
This revision is now accepted and ready to land.
LGTM with a couple of tweaks.
Comment at: lib/CodeGen/CGCXX.cpp:45-46
@@ +44,4 @@
+ // an alias, unless this class owns no members.
+ unsigned totalFields =
+ std::dis
nmusgrave updated this revision to Diff 33978.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Simplified fields and checks for aliasing.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGen
rsmith added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:140-147
@@ -131,1 +139,10 @@
+ // If sanitizing memory to check for use-after-dtor, do not emit as
+ // an alias, unless this class owns no members with trivial destructors.
+ const CXXMethodDecl *MD =
+ ca
nmusgrave updated this revision to Diff 33959.
nmusgrave added a comment.
- Refined testing for bit fields.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-bit-field.cpp
test/CodeGenCXX/sanit
nmusgrave updated this revision to Diff 33956.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Testing sanitizing bit fields.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize
rsmith added a comment.
I'd like to see some tests for poisoning bitfields, and particularly anonymous
bitfields (I think the code works fine in those cases, but they're a bit
special so explicitly testing them is useful).
Comment at: lib/CodeGen/CGCXX.cpp:151
@@ +150,3 @@
+
eugenis added a comment.
LGTM but please wait for Richard's answer
Comment at: lib/CodeGen/CGClass.cpp:1551
@@ +1550,3 @@
+ // Prevent the current stack frame from disappearing from the stack
trace.
+ CGF.CurFn->addFnAttr("disable-tail-calls", "true");
+
-
nmusgrave updated this revision to Diff 33887.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Update comments, consistent style for attribute checking.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
eugenis added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:45
@@ +44,3 @@
+ // destructors.
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor)
+return true;
This simply suppresses all dtor alias under UseAfterDtor, effectively disabling
the second che
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:42-44
@@ -33,1 +41,5 @@
bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
+ // If sanitizing memory to check for use-after-dtor, do not emit as
+ // an alias, unless it has no fields
nmusgrave updated this revision to Diff 33752.
nmusgrave marked 13 inline comments as done.
nmusgrave added a comment.
- Simplified implementation of class field poisoning, to avoid redundant
counting and conditional checks. Expensive checks delayed.
http://reviews.llvm.org/D12022
Files:
lib
eugenis added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:42-44
@@ -33,1 +41,5 @@
bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
+ // If sanitizing memory to check for use-after-dtor, do not emit as
+ // an alias, unless it has no fields o
rsmith added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:42-44
@@ -33,1 +41,5 @@
bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) {
+ // If sanitizing memory to check for use-after-dtor, do not emit as
+ // an alias, unless it has no fields or
nmusgrave updated this revision to Diff 33463.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Alias-repressing test case ignores casting of pointers.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
nmusgrave added inline comments.
Comment at: test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp:30
@@ +29,2 @@
+// Definition of virtual function table
+// CHECK: @_ZTV7Derived = {{.*}}(void (%struct.Derived*)* @_ZN7DerivedD1Ev to
i8*){{.*}}(void (%struct.Derived*)* @_ZN7DerivedD
nmusgrave marked 3 inline comments as done.
nmusgrave added a comment.
http://reviews.llvm.org/D12022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nmusgrave updated this revision to Diff 33436.
nmusgrave added a comment.
- Checking for existence of fields to poison in alias emission.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-nontriv
eugenis added a comment.
Richard, would you mind taking a look a this change?
http://reviews.llvm.org/D12022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
nmusgrave updated this revision to Diff 33115.
nmusgrave added a comment.
- Simplify parameters, rename function, for examining fields of class to
destroy.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sa
eugenis added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:31
@@ -30,1 +30,3 @@
+static bool HasTrivialField(CodeGenModule &CGM, const CXXDestructorDecl *D) {
+ for (const auto *Field : D->getParent()->fields())
I think this should be called "HasFieldWith
nmusgrave updated this revision to Diff 33100.
nmusgrave marked an inline comment as done.
nmusgrave added a comment.
- Check flags before dtor sanitizing
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sani
nmusgrave updated this revision to Diff 33037.
nmusgrave marked 4 inline comments as done.
nmusgrave added a comment.
- Simplify function invocations
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-
eugenis added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:44
@@ +43,3 @@
+ // destructors.
+ const ASTRecordLayout &Layout = Context.getASTRecordLayout(D->getParent());
+
This is unused.
Comment at: lib/CodeGen/CGCXX.cpp:47
@@ +46,3 @@
+
nmusgrave updated this revision to Diff 32986.
nmusgrave added a comment.
- Refactored for simpler trivial field checking
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
lib/CodeGen/CodeGenModule.h
test/CodeGenCXX/sanitize-dtor-nontrivial-virtual-base
nmusgrave updated this revision to Diff 32930.
nmusgrave added a comment.
- Refactoring dtor sanitizing emission order
- support for virtual functions & virtual bases WIP
- Repress dtor aliasing when sanitizing in dtor
- CFE test for dtor aliasing, and repression of aliasing in dtor code
generati
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGClass.cpp:1578
@@ +1577,3 @@
+if (CGF.CGM.FieldHasTrivialDestructorBody(Context, Field) ||
+Field->getType()->isPointerType()) {
+ // Start sanitizing at this field
eugenis wro
eugenis added inline comments.
Comment at: lib/CodeGen/CGClass.cpp:1578
@@ +1577,3 @@
+if (CGF.CGM.FieldHasTrivialDestructorBody(Context, Field) ||
+Field->getType()->isPointerType()) {
+ // Start sanitizing at this field
Why do you ne
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+ && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+return true;
nmusgrave added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+ && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+return true;
eugenis added inline comments.
Comment at: lib/CodeGen/CGCXX.cpp:41
@@ +40,3 @@
+ if (getCodeGenOpts().SanitizeMemoryUseAfterDtor && Layout.getFieldCount() > 0
+ && HasTrivialDestructorBody(Context, D->getParent(), D->getParent())) {
+return true;
I'
nmusgrave updated this revision to Diff 32873.
nmusgrave marked 2 inline comments as done.
nmusgrave added a comment.
- Poisoning on field-by-field basis, with collective poisoning of trivial
members when possible.
- Cleaned up implementation of calculating region to poison in dtor.
http://revi
eugenis added a comment.
The test for virtual base that you added effectively disables the aliasing
test, because Derived now has non-trivial members.
Move it to a separate file.
Comment at: test/CodeGenCXX/sanitize-dtor-repress-aliasing.cpp:38
@@ +37,3 @@
+// Declaration of vi
nmusgrave updated this revision to Diff 32608.
nmusgrave added a comment.
- More complex testing for destruction order. Tests class with base, virtual
base, trivial, and nontrivial member to ensure destruction order is correct.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
li
nmusgrave updated this revision to Diff 32600.
nmusgrave added a comment.
- CFE test for dtor aliasing, and repression of aliasing in dtor code
generation.
http://reviews.llvm.org/D12022
Files:
lib/CodeGen/CGCXX.cpp
lib/CodeGen/CGClass.cpp
test/CodeGenCXX/sanitize-dtor-repress-aliasing.c
eugenis added a comment.
+cfe-commits
http://reviews.llvm.org/D12022
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
36 matches
Mail list logo