[PATCH] D11106: use-after-dtor cmd option
Evgeniy Stepanov
eugenis at google.com
Fri Jul 10 14:43:40 PDT 2015
eugenis added inline comments.
================
Comment at: lib/CodeGen/CGClass.cpp:1468-1476
@@ +1467,11 @@
+ ArgTypes.push_back(IntTy);
+ const ASTRecordLayout &Layout =
+ getContext().getASTRecordLayout(Dtor->getParent());
+ Args.push_back(
+ llvm::ConstantInt::get(CGM.IntTy, Layout.getSize().getQuantity()));
+
+ llvm::FunctionType *FnType =
+ llvm::FunctionType::get(CGM.VoidTy, ArgTypes, false);
+ llvm::Value *Fn =
+ CGM.CreateRuntimeFunction(FnType, "__sanitizer_dtor_exit_callback");
+ EmitNounwindRuntimeCall(Fn, Args);
----------------
majnemer wrote:
> I couldn't find a definition of `__sanitizer_dtor_exit_callback` but `int` seems like the wrong type if it is supposed to hold the size of the record.
>
> Consider:
> struct S { char x[1ULL << 32]; ~S() {} } s;
>
> This type will have size 4294967296 but will be represent as 0 if coerced to an int type on most (all?) 64-bit platforms.
__sanitizer_dtor_exit_callback is not implemented yet.
Yes, it should accept (void *, size_t).
http://reviews.llvm.org/D11106
More information about the llvm-commits
mailing list