import transform fix into autodict, code-format
MODIFY
examples/afl_untracer/afl-untracer.c
examples/afl_untracer/afl-untracer.c
@@ -285,6 +285,7 @@ void breakpoint() {
if (debug) fprintf(stderr, "Breakpoint function \"breakpoint\" reached.\n");
}
+
#pragma GCC pop_options
/* Error reporting to forkserver controller */
@@ -510,8 +511,10 @@ void setup_trap_instrumentation() {
// Create shadow memory.
#ifdef __aarch64__
for (int i = 0; i < 8; i++) {
+
#else
for (int i = 0; i < 4; i++) {
+
#endif
void *shadow_addr = SHADOW(lib_addr + i);
@@ -549,7 +552,8 @@ void setup_trap_instrumentation() {
// Make lookup entry in shadow memory.
-#if ((defined(__APPLE__) && defined(__LP64__)) || defined(__x86_64__) || defined(__i386__))
+#if ((defined(__APPLE__) && defined(__LP64__)) || defined(__x86_64__) || \
+ defined(__i386__))
// this is for Intel x64

MODIFY
llvm_mode/afl-clang-fast.c
llvm_mode/afl-clang-fast.c
@@ -718,7 +718,9 @@ int main(int argc, char **argv, char **envp) {
}
if (instrument_opt_mode && lto_mode)
- FATAL("CTX and NGRAM can not be used in LTO mode (and would make LTO useless)");
+ FATAL(
+ "CTX and NGRAM can not be used in LTO mode (and would make LTO "
+ "useless)");
if (!instrument_opt_mode) {

MODIFY
llvm_mode/afl-llvm-lto-instrim.so.cc
llvm_mode/afl-llvm-lto-instrim.so.cc
@@ -346,6 +346,8 @@ struct InsTrimLTO : public ModulePass {
if (auto *Var =
dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
+ if (Var->hasInitializer()) {
+
if (auto *Array = dyn_cast<ConstantDataArray>(
Var->getInitializer())) {
@@ -360,6 +362,8 @@ struct InsTrimLTO : public ModulePass {
}
+ }
+
// for the internal memcpy routine we only care for the second
// parameter and are not reporting anything.
if (isIntMemcpy == true) {
@@ -419,6 +423,8 @@ struct InsTrimLTO : public ModulePass {
if (auto *Var =
dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
+ if (Var->hasInitializer()) {
+
if (auto *Array = dyn_cast<ConstantDataArray>(
Var->getInitializer())) {
@@ -433,6 +439,8 @@ struct InsTrimLTO : public ModulePass {
}
+ }
+
// Neither a literal nor a global variable?
// maybe it is a local variable that we saved
if (!HasStr1) {

MODIFY
llvm_mode/afl-llvm-lto-instrumentation.so.cc
llvm_mode/afl-llvm-lto-instrumentation.so.cc
@@ -326,8 +326,10 @@ 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())) {
HasStr2 = true;
Str2 = Array->getAsString().str();
@@ -340,6 +342,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
}
+ }
+
// for the internal memcpy routine we only care for the second
// parameter and are not reporting anything.
if (isIntMemcpy == true) {
@@ -398,8 +402,10 @@ 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();
@@ -412,6 +418,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
}
+ }
+
// Neither a literal nor a global variable?
// maybe it is a local variable that we saved
if (!HasStr1) {

import transform fix into autodict, code-format