[PATCH] [RFC] Print exact source locations of global variables in ASan error reports.

Alexey Samsonov vonosmas at gmail.com
Mon Jun 23 23:24:21 PDT 2014


================
Comment at: lib/Transforms/Instrumentation/AddressSanitizer.cpp:1069
@@ -1004,2 +1068,3 @@
     GlobalVariable *G = GlobalsToChange[i];
+
     PointerType *PtrTy = cast<PointerType>(G->getType());
----------------
Alexander Potapenko wrote:
> nit: spare newline?
Done

================
Comment at: projects/compiler-rt/test/asan/TestCases/global-location.cc:11
@@ +10,3 @@
+
+class C {
+ public:
----------------
Alexander Potapenko wrote:
> "struct C", maybe?
Done

================
Comment at: projects/compiler-rt/test/asan/TestCases/global-location.cc:17
@@ +16,3 @@
+int global[10];
+// GLOB: 0x{{.*}} is located 4 bytes to the right of global variable 'global' defined in '{{.*}}/global-location.cc:[[@LINE-1]]:5' {{.*}} of size 40
+int C::array[10];
----------------
Alexander Potapenko wrote:
> Do you need  the slash before global-location.cc? Isn't it possible that there's no directory prefix (maybe not in the current setup)?
Done.

http://reviews.llvm.org/D4203






More information about the cfe-commits mailing list