mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-10-06 14:57:41 +00:00
Fix alloca_instruments_all_paddings.cc test to work under higher -O levels (llvm part)
When AddressSanitizer only a single dynamic alloca and no static allocas, due to an early exit from FunctionStackPoisoner::poisonStack we forget to unpoison the dynamic alloca. This patch fixes that. Reviewed at http://reviews.llvm.org/D7810 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230316 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
c3b9d471f6
commit
81dce4c02c
@ -1644,10 +1644,13 @@ Value *FunctionStackPoisoner::createAllocaForLayout(
|
||||
void FunctionStackPoisoner::poisonStack() {
|
||||
assert(AllocaVec.size() > 0 || DynamicAllocaVec.size() > 0);
|
||||
|
||||
if (ClInstrumentAllocas)
|
||||
if (ClInstrumentAllocas) {
|
||||
// Handle dynamic allocas.
|
||||
for (auto &AllocaCall : DynamicAllocaVec)
|
||||
for (auto &AllocaCall : DynamicAllocaVec) {
|
||||
handleDynamicAllocaCall(AllocaCall);
|
||||
unpoisonDynamicAlloca(AllocaCall);
|
||||
}
|
||||
}
|
||||
|
||||
if (AllocaVec.size() == 0) return;
|
||||
|
||||
@ -1826,11 +1829,6 @@ void FunctionStackPoisoner::poisonStack() {
|
||||
}
|
||||
}
|
||||
|
||||
if (ClInstrumentAllocas)
|
||||
// Unpoison dynamic allocas.
|
||||
for (auto &AllocaCall : DynamicAllocaVec)
|
||||
unpoisonDynamicAlloca(AllocaCall);
|
||||
|
||||
// We are done. Remove the old unused alloca instructions.
|
||||
for (auto AI : AllocaVec)
|
||||
AI->eraseFromParent();
|
||||
|
Loading…
Reference in New Issue
Block a user