[llvm-commits] [PATCH] [ASan] fix lifetime intrinsics handling
Kostya Serebryany
kcc at google.com
Wed Dec 26 23:55:21 PST 2012
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:328
@@ +327,3 @@
+
+ // Used to store allocas which values come from.
+ typedef DenseMap<Value*, AllocaInst*> AllocaForValueMapTy;
----------------
Maybe like this?
Maps Value to an AllocaInst from which the Value is originated
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1238
@@ +1237,3 @@
+ bool HavePoisonedAllocas = false;
+ if (ASan.CheckLifetime) {
+ for (size_t i = 0, n = AllocaPoisonCallVec.size(); i < n; i++) {
----------------
do you need this if?
If it's false, the vector will be empty.
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1343
@@ +1342,3 @@
+ // infinite recursion if the value references itself.
+ AllocaForValue[V] = 0;
+ AllocaInst *Res = 0;
----------------
Res = AllocaForValue[V]; // Creates a 0 value if there is not such element.
if (Res)
return Res;
================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:329
@@ +328,3 @@
+ // Used to store allocas which values come from.
+ typedef DenseMap<Value*, AllocaInst*> AllocaForValueMapTy;
+ AllocaForValueMapTy AllocaForValue;
----------------
no need for this typedef anymore
http://llvm-reviews.chandlerc.com/D244
More information about the llvm-commits
mailing list