[PATCH] D11189: adding tests for various dtor decl types

Evgeniy Stepanov eugenis at google.com
Tue Jul 14 18:27:01 PDT 2015


eugenis added inline comments.

================
Comment at: test/CodeGenCXX/sanitize-default-dtor-callback.cpp:39
@@ +38,3 @@
+// forced to generate a non-trivial destructor. Members at this level
+// should be poisoned before base class members.
+// CHECK-LABEL: define {{.*}}Defaulted_Non_TrivialD2Ev
----------------
This is not what's happening here. Just read the bitcode (FileCheck input):

define linkonce_odr void @_ZN21Defaulted_Non_TrivialD1Ev(%struct.Defaulted_Non_Trivial* %this) unnamed_addr #0 comdat align 2 {
...
  call void @__sanitizer_dtor_callback(i8* %11, i64 1) #1
  ret void
}


define linkonce_odr void @_ZN6SimpleD1Ev(%struct.Simple* %this) unnamed_addr #0 comdat align 2 {
...
call void @_ZN6SimpleD2Ev(%struct.Simple* %this1) #1
...
call void @__sanitizer_dtor_callback(i8* %11, i64 1) #1
  ret void
}

define linkonce_odr void @_ZN6SimpleD2Ev(%struct.Simple* %this) unnamed_addr #0 comdat align 2 {
...
  call void @__sanitizer_dtor_callback(i8* %11, i64 1) #1
  ret void
}

The CHECKs are matching code from 2 or 3 different functions.
I suggest adding CHECK-LABEL and CHECK: ret void for all destructors that are emitted for this file to avoid this.
Also, it looks like we insert instrumentation in 2 different destructors of struct Simple, and one of them calls the other. This poisons the object twice.



http://reviews.llvm.org/D11189







More information about the cfe-commits mailing list