[PATCH] D15365: Cross-DSO control flow integrity (LLVM part)

Evgeniy Stepanov via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 11 17:07:05 PST 2015


eugenis added inline comments.

================
Comment at: lib/Transforms/IPO/CrossDSOCFI.cpp:111
@@ +110,3 @@
+          Type::getVoidTy(Ctx),
+          {Type::getInt64Ty(Ctx), PointerType::getUnqual(Type::getInt8Ty(Ctx))},
+          false));
----------------
pcc wrote:
> I think this will break if the `ConstantInt`s are not of type i64. Can you handle this gracefully?
Do we really need to handle this case? Frontend never inserts constantints in the bitset metadata that are not i64, and we can make this a requirement.

================
Comment at: lib/Transforms/IPO/CrossDSOCFI.cpp:140
@@ +139,3 @@
+  SwitchInst *SI = IRB.CreateSwitch(TypeId, TrapBB, BitSetIds.size());
+  for (ConstantInt *CaseTypeId : BitSetIds) {
+    BasicBlock *TestBB = BasicBlock::Create(Ctx, "test", F);
----------------
pcc wrote:
> Isn't this non-deterministic? I think it will depend on the `ConstantInt` addresses.
Good catch. Fixed.


Repository:
  rL LLVM

http://reviews.llvm.org/D15365





More information about the llvm-commits mailing list