fix kctx compilation hang

This commit is contained in:
Andrea Fioraldi
2021-03-04 15:12:08 +01:00
parent 0aa93afeb8
commit be5274d4a9
2 changed files with 9 additions and 5 deletions

View File

@ -81,6 +81,7 @@ static char *afl_environment_variables[] = {
"AFL_LLVM_CMPLOG", "AFL_LLVM_CMPLOG",
"AFL_LLVM_INSTRIM", "AFL_LLVM_INSTRIM",
"AFL_LLVM_CTX", "AFL_LLVM_CTX",
"AFL_LLVM_CTX_K",
"AFL_LLVM_DICT2FILE", "AFL_LLVM_DICT2FILE",
"AFL_LLVM_DOCUMENT_IDS", "AFL_LLVM_DOCUMENT_IDS",
"AFL_LLVM_INSTRIM_LOOPHEAD", "AFL_LLVM_INSTRIM_LOOPHEAD",

View File

@ -363,15 +363,18 @@ bool AFLCoverage::runOnModule(Module &M) {
Constant *PrevLocShuffleMask = ConstantVector::get(PrevLocShuffle); Constant *PrevLocShuffleMask = ConstantVector::get(PrevLocShuffle);
Constant *PrevCallerShuffleMask = NULL;
SmallVector<Constant *, 32> PrevCallerShuffle = {UndefValue::get(Int32Ty)}; SmallVector<Constant *, 32> PrevCallerShuffle = {UndefValue::get(Int32Ty)};
for (unsigned I = 0; I < PrevCallerSize - 1; ++I) if (ctx_k) {
PrevCallerShuffle.push_back(ConstantInt::get(Int32Ty, I)); for (unsigned I = 0; I < PrevCallerSize - 1; ++I)
PrevCallerShuffle.push_back(ConstantInt::get(Int32Ty, I));
for (int I = PrevCallerSize; I < PrevCallerVecSize; ++I) for (int I = PrevCallerSize; I < PrevCallerVecSize; ++I)
PrevCallerShuffle.push_back(ConstantInt::get(Int32Ty, PrevCallerSize)); PrevCallerShuffle.push_back(ConstantInt::get(Int32Ty, PrevCallerSize));
Constant *PrevCallerShuffleMask = ConstantVector::get(PrevCallerShuffle); PrevCallerShuffleMask = ConstantVector::get(PrevCallerShuffle);
}
#endif #endif
// other constants we need // other constants we need