diff options
author | van Hauser <vh@thc.org> | 2020-02-07 21:48:44 +0100 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-02-07 21:48:44 +0100 |
commit | daddc92b4a5b3d9a30255615908e643365f64f53 (patch) | |
tree | 4e5f258bf1dd547c421670965f0928adde519fb1 /libAflDyninst.cpp | |
parent | 7c578962358be549868aaf9fbb12e4c03701a880 (diff) | |
download | afl-dyninst-daddc92b4a5b3d9a30255615908e643365f64f53.tar.gz |
-l fix (first iteration)
Diffstat (limited to 'libAflDyninst.cpp')
-rw-r--r-- | libAflDyninst.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libAflDyninst.cpp b/libAflDyninst.cpp index e7c2a0f..af2d9f4 100644 --- a/libAflDyninst.cpp +++ b/libAflDyninst.cpp @@ -1,4 +1,5 @@ #include "config.h" +#include "dyninstversion.h" // if this include errors, compile and install https://github.com/dyninst/dyninst #include <algorithm> #include <cstdio> #include <cstdlib> @@ -23,8 +24,10 @@ static unsigned short int prev_id = 0; static bool forkserver_installed = false; #if (__amd64__ || __x86_64__) static long saved_di; +#if (DYNINST_MAJOR_VERSION < 10) register long rdi asm("di"); // the warning is fine - we need the warning because of a bug in dyninst9 #endif +#endif #define PRINT_ERROR(string) (void)(write(2, string, strlen(string)) + 1) // the (...+1) weirdness is so we do not get an ignoring return value warning @@ -91,17 +94,21 @@ void bbCallback(unsigned short id) { void forceCleanExit() { exit(0); } +#if (DYNINST_MAJOR_VERSION < 10) void save_rdi() { #if __amd64__ || __x86_64__ saved_di = rdi; #endif } +#endif +#if (DYNINST_MAJOR_VERSION < 10) void restore_rdi() { #if __amd64__ || __x86_64__ rdi = saved_di; #endif } +#endif void initOnlyAflForkServer() { if (forkserver_installed == true) |