import transform fix into autodict, code-format

This commit is contained in:
van Hauser
2020-05-07 08:08:20 +02:00
parent 01b5aa123d
commit 140053502b
4 changed files with 58 additions and 36 deletions

View File

@ -285,6 +285,7 @@ void breakpoint() {
if (debug) fprintf(stderr, "Breakpoint function \"breakpoint\" reached.\n"); if (debug) fprintf(stderr, "Breakpoint function \"breakpoint\" reached.\n");
} }
#pragma GCC pop_options #pragma GCC pop_options
/* Error reporting to forkserver controller */ /* Error reporting to forkserver controller */
@ -510,8 +511,10 @@ void setup_trap_instrumentation() {
// Create shadow memory. // Create shadow memory.
#ifdef __aarch64__ #ifdef __aarch64__
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
#else #else
for (int i = 0; i < 4; i++) { for (int i = 0; i < 4; i++) {
#endif #endif
void *shadow_addr = SHADOW(lib_addr + i); void *shadow_addr = SHADOW(lib_addr + i);
@ -549,7 +552,8 @@ void setup_trap_instrumentation() {
// Make lookup entry in shadow memory. // 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 // this is for Intel x64

View File

@ -718,7 +718,9 @@ int main(int argc, char **argv, char **envp) {
} }
if (instrument_opt_mode && lto_mode) 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) { if (!instrument_opt_mode) {

View File

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

View File

@ -326,8 +326,10 @@ bool AFLLTOPass::runOnModule(Module &M) {
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) { if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
if (auto *Array = if (Var->hasInitializer()) {
dyn_cast<ConstantDataArray>(Var->getInitializer())) {
if (auto *Array = dyn_cast<ConstantDataArray>(
Var->getInitializer())) {
HasStr2 = true; HasStr2 = true;
Str2 = Array->getAsString().str(); Str2 = Array->getAsString().str();
@ -340,6 +342,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
} }
}
// for the internal memcpy routine we only care for the second // for the internal memcpy routine we only care for the second
// parameter and are not reporting anything. // parameter and are not reporting anything.
if (isIntMemcpy == true) { if (isIntMemcpy == true) {
@ -398,8 +402,10 @@ bool AFLLTOPass::runOnModule(Module &M) {
if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) { if (auto *Var = dyn_cast<GlobalVariable>(Ptr->getOperand(0))) {
if (auto *Array = if (Var->hasInitializer()) {
dyn_cast<ConstantDataArray>(Var->getInitializer())) {
if (auto *Array = dyn_cast<ConstantDataArray>(
Var->getInitializer())) {
HasStr1 = true; HasStr1 = true;
Str1 = Array->getAsString().str(); Str1 = Array->getAsString().str();
@ -412,6 +418,8 @@ bool AFLLTOPass::runOnModule(Module &M) {
} }
}
// Neither a literal nor a global variable? // Neither a literal nor a global variable?
// maybe it is a local variable that we saved // maybe it is a local variable that we saved
if (!HasStr1) { if (!HasStr1) {