diff options
author | Kuba Brecka <kuba.brecka@gmail.com> | 2015-07-17 19:20:21 +0000 |
---|---|---|
committer | Kuba Brecka <kuba.brecka@gmail.com> | 2015-07-17 19:20:21 +0000 |
commit | 7f5475318044507d6a43550422ddc431109ae079 (patch) | |
tree | 55fdf84fdb78a0c6b3725f29d40dee3b6b5fd824 /llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | |
parent | 2e3b97d4fbdfa33367ffae04db000daeb43fdcdf (diff) | |
download | bcm5719-llvm-7f5475318044507d6a43550422ddc431109ae079.tar.gz bcm5719-llvm-7f5475318044507d6a43550422ddc431109ae079.zip |
[asan] Add a comment explaining why non-instrumented allocas are moved.
Addition to r242510.
llvm-svn: 242561
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index a67a9a217a4..a98439b6b39 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1738,6 +1738,9 @@ void FunctionStackPoisoner::poisonStack() { IRBuilder<> IRB(InsBefore); IRB.SetCurrentDebugLocation(EntryDebugLocation); + // Make sure non-instrumented allocas stay in the first basic block. + // Otherwise, debug info is broken, because only first-basic-block allocas are + // treated as regular stack slots. for (auto *AI : NonInstrumentedStaticAllocaVec) AI->moveBefore(InsBefore); SmallVector<ASanStackVariableDescription, 16> SVD; |