Skip to content

Commit

Permalink
[asan] Add a comment explaining why non-instrumented allocas are moved.
Browse files Browse the repository at this point in the history
Addition to r242510.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@242561 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
kubamracek committed Jul 17, 2015
1 parent beda80e commit b8850e4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/Transforms/Instrumentation/AddressSanitizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b8850e4

Please sign in to comment.