diff options
author | van Hauser <vh@thc.org> | 2020-05-07 08:08:20 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-05-07 08:08:20 +0200 |
commit | 140053502bd5ce162ab7e6bfbb151494381d704c (patch) | |
tree | 6a4718027fc5c3bbc5d0a41ac5dd67670bdc5ceb /llvm_mode/afl-llvm-lto-instrumentation.so.cc | |
parent | 01b5aa123df8200f6c071f6ee1f3c05722b12fee (diff) | |
download | afl++-140053502bd5ce162ab7e6bfbb151494381d704c.tar.gz |
import transform fix into autodict, code-format
Diffstat (limited to 'llvm_mode/afl-llvm-lto-instrumentation.so.cc')
-rw-r--r-- | llvm_mode/afl-llvm-lto-instrumentation.so.cc | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/llvm_mode/afl-llvm-lto-instrumentation.so.cc b/llvm_mode/afl-llvm-lto-instrumentation.so.cc index 79081d37..0e353fdf 100644 --- a/llvm_mode/afl-llvm-lto-instrumentation.so.cc +++ b/llvm_mode/afl-llvm-lto-instrumentation.so.cc @@ -326,11 +326,15 @@ bool AFLLTOPass::runOnModule(Module &M) { if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) { - if (auto *Array = - dyn_cast<ConstantDataArray>(Var->getInitializer())) { + if (Var->hasInitializer()) { - HasStr2 = true; - Str2 = Array->getAsString().str(); + if (auto *Array = dyn_cast<ConstantDataArray>( + Var->getInitializer())) { + + HasStr2 = true; + Str2 = Array->getAsString().str(); + + } } @@ -398,11 +402,15 @@ bool AFLLTOPass::runOnModule(Module &M) { if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) { - if (auto *Array = - dyn_cast<ConstantDataArray>(Var->getInitializer())) { + if (Var->hasInitializer()) { + + if (auto *Array = dyn_cast<ConstantDataArray>( + Var->getInitializer())) { + + HasStr1 = true; + Str1 = Array->getAsString().str(); - HasStr1 = true; - Str1 = Array->getAsString().str(); + } } |