mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-10 17:21:33 +00:00
fix
This commit is contained in:
parent
ceb7e44e6f
commit
e6eee685ce
@ -261,6 +261,7 @@ class ModuleSanitizerCoverageLTO
|
|||||||
IntegerType *Int32Tyi = NULL;
|
IntegerType *Int32Tyi = NULL;
|
||||||
IntegerType *Int64Tyi = NULL;
|
IntegerType *Int64Tyi = NULL;
|
||||||
ConstantInt *Zero = NULL;
|
ConstantInt *Zero = NULL;
|
||||||
|
ConstantInt *Zero32 = NULL;
|
||||||
ConstantInt *One = NULL;
|
ConstantInt *One = NULL;
|
||||||
AllocaInst *CTX_add = NULL;
|
AllocaInst *CTX_add = NULL;
|
||||||
LLVMContext *Ct = NULL;
|
LLVMContext *Ct = NULL;
|
||||||
@ -513,6 +514,7 @@ bool ModuleSanitizerCoverageLTO::instrumentModule(
|
|||||||
GlobalVariable::GeneralDynamicTLSModel, 0, false);
|
GlobalVariable::GeneralDynamicTLSModel, 0, false);
|
||||||
|
|
||||||
Zero = ConstantInt::get(Int8Tyi, 0);
|
Zero = ConstantInt::get(Int8Tyi, 0);
|
||||||
|
Zero32 = ConstantInt::get(Int32Tyi, 0);
|
||||||
One = ConstantInt::get(Int8Tyi, 1);
|
One = ConstantInt::get(Int8Tyi, 1);
|
||||||
|
|
||||||
initInstrumentList();
|
initInstrumentList();
|
||||||
@ -1426,7 +1428,7 @@ void ModuleSanitizerCoverageLTO::instrumentFunction(
|
|||||||
if (inst == inst_save || call_counter < 2) {
|
if (inst == inst_save || call_counter < 2) {
|
||||||
|
|
||||||
fprintf(stderr, "%s: ZERO!\n", F.getName().str().c_str());
|
fprintf(stderr, "%s: ZERO!\n", F.getName().str().c_str());
|
||||||
CTX_offset = Zero;
|
CTX_offset = Zero32;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -1453,7 +1455,7 @@ void ModuleSanitizerCoverageLTO::instrumentFunction(
|
|||||||
|
|
||||||
IRBuilder<> Builder(IN.getContext());
|
IRBuilder<> Builder(IN.getContext());
|
||||||
Builder.SetInsertPoint(IN.getParent(), IN.getIterator());
|
Builder.SetInsertPoint(IN.getParent(), IN.getIterator());
|
||||||
StoreInst *StoreCtx = Builder.CreateStore(Zero, AFLContext);
|
StoreInst *StoreCtx = Builder.CreateStore(Zero32, AFLContext);
|
||||||
StoreCtx->setMetadata("nosanitize", N);
|
StoreCtx->setMetadata("nosanitize", N);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1474,7 +1476,7 @@ void ModuleSanitizerCoverageLTO::instrumentFunction(
|
|||||||
auto BB = &F.getEntryBlock();
|
auto BB = &F.getEntryBlock();
|
||||||
if (!BB) {
|
if (!BB) {
|
||||||
|
|
||||||
fprintf(stderr, "NULL %s %p\n", F.getName().str().c_str(), BB);
|
fprintf(stderr, "NULL entry %s %p\n", F.getName().str().c_str(), BB);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1482,7 +1484,7 @@ void ModuleSanitizerCoverageLTO::instrumentFunction(
|
|||||||
BasicBlock::iterator IP = BB->getFirstInsertionPt();
|
BasicBlock::iterator IP = BB->getFirstInsertionPt();
|
||||||
IRBuilder<> IRB(&(*IP));
|
IRBuilder<> IRB(&(*IP));
|
||||||
CTX_add = IRB.CreateAlloca(Type::getInt32Ty(Context), nullptr, "CTX_add");
|
CTX_add = IRB.CreateAlloca(Type::getInt32Ty(Context), nullptr, "CTX_add");
|
||||||
auto nosan = IRB.CreateStore(Zero, CTX_add);
|
auto nosan = IRB.CreateStore(Zero32, CTX_add);
|
||||||
nosan->setMetadata("nosanitize", N);
|
nosan->setMetadata("nosanitize", N);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user