[PATCH] D16823: [cfi] Safe handling of unaddressable vtable pointers (clang).
Alexey Samsonov via cfe-commits
cfe-commits at lists.llvm.org
Tue Feb 2 17:38:59 PST 2016
samsonov added inline comments.
================
Comment at: lib/CodeGen/CGExpr.cpp:2642
@@ +2641,3 @@
+ llvm::MDString::get(CGM.getLLVMContext(), "all-vtables"));
+ llvm::Value *ValidVtable = Builder.CreateZExt(
+ Builder.CreateCall(CGM.getIntrinsic(llvm::Intrinsic::bitset_test),
----------------
This is almost the same as EmitVTablePtrCheck, but with ZExt? Is the difference intentional/important? Is it possible to extract this logic (getting "all-vtables" metadata and running bitset test) to a function?
================
Comment at: lib/CodeGen/CodeGenModule.cpp:4034
@@ +4033,3 @@
+ // is not in the trapping mode.
+ return ((LangOpts.Sanitize.has(SanitizerKind::CFIVCall) &&
+ !CodeGenOpts.SanitizeTrap.has(SanitizerKind::CFIVCall)) ||
----------------
Hm, can you write this as a loop?
Repository:
rL LLVM
http://reviews.llvm.org/D16823
More information about the cfe-commits
mailing list