[llvm-commits] [PATCH] AddressSanitizer: handle llvm.lifetime intrinsics (LLVM part)
Alexey Samsonov
samsonov at google.com
Fri Nov 30 10:32:33 PST 2012
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1121
@@ +1120,3 @@
+ if (AllocaType == Int8PtrTy)
+ Res |= handleValueLifetime(Alloca);
+ for (Value::use_iterator UI = Alloca->use_begin(), UE = Alloca->use_end();
----------------
Kostya Serebryany wrote:
> This function where you call handleValueLifetime multiple times is hard to understand. I'd really prefer to iterate over all llvm.lifetime.start
> markers instead.
I've added comment to the original function. I think that iterating over lifetime markers wouldn't be easier: you'll have to store the set of allocas we merge (ok), but when you take a lifetime marker, you should check if its argument was in fact casted from the one of these allocas...
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1281
@@ +1280,3 @@
+ Value *SizeArg = ConstantInt::get(IntptrTy, Size);
+ if (DoPoison)
+ IRB.CreateCall2(AsanPoisonStackMemoryFunc, AddrArg, SizeArg);
----------------
Kostya Serebryany wrote:
> maybe like this?
> DoPoison ? AsanPoisonStackMemoryFunc : AsanUnpoisonStackMemoryFunc
Done
http://llvm-reviews.chandlerc.com/D140
More information about the llvm-commits
mailing list