code-format

This commit is contained in:
van Hauser
2020-05-10 10:24:24 +02:00
parent 0e5a5f1805
commit 2e553bcd69
5 changed files with 21 additions and 17 deletions

View File

@ -154,19 +154,19 @@ typedef int64_t s64;
#define MEM_BARRIER() __asm__ volatile("" ::: "memory") #define MEM_BARRIER() __asm__ volatile("" ::: "memory")
#if __GNUC__ < 6 #if __GNUC__ < 6
# ifndef likely #ifndef likely
# define likely(_x) (_x) #define likely(_x) (_x)
# endif #endif
# ifndef unlikely #ifndef unlikely
# define unlikely(_x) (_x) #define unlikely(_x) (_x)
# endif #endif
#else #else
# ifndef likely #ifndef likely
# define likely(_x) __builtin_expect(!!(_x), 1) #define likely(_x) __builtin_expect(!!(_x), 1)
# endif #endif
# ifndef unlikely #ifndef unlikely
# define unlikely(_x) __builtin_expect(!!(_x), 0) #define unlikely(_x) __builtin_expect(!!(_x), 0)
# endif #endif
#endif #endif
#endif /* ! _HAVE_TYPES_H */ #endif /* ! _HAVE_TYPES_H */

View File

@ -143,7 +143,7 @@ struct InsTrim : public ModulePass {
char *ctx_str = getenv("AFL_LLVM_CTX"); char *ctx_str = getenv("AFL_LLVM_CTX");
#ifdef AFL_HAVE_VECTOR_INTRINSICS #ifdef AFL_HAVE_VECTOR_INTRINSICS
int ngram_size = 0; int ngram_size = 0;
/* Decide previous location vector size (must be a power of two) */ /* Decide previous location vector size (must be a power of two) */
VectorType *PrevLocTy; VectorType *PrevLocTy;
@ -359,6 +359,7 @@ struct InsTrim : public ModulePass {
MDNode::get(C, None)); MDNode::get(C, None));
} else } else
#endif #endif
{ {

View File

@ -337,16 +337,18 @@ static void edit_params(u32 argc, char **argv, char **envp) {
// e.g. compiled download or compiled from github then it's ./lib directory // e.g. compiled download or compiled from github then it's ./lib directory
// might not be in the search path. Add it if so. // might not be in the search path. Add it if so.
u8 *libdir = strdup(LLVM_LIBDIR); u8 *libdir = strdup(LLVM_LIBDIR);
if (strlen(libdir) && strncmp(libdir, "/usr", 4) && if (cpp_mode && strlen(libdir) && strncmp(libdir, "/usr", 4) &&
strncmp(libdir, "/lib", 4)) { strncmp(libdir, "/lib", 4)) {
cc_params[cc_par_cnt++] = "-rpath"; cc_params[cc_par_cnt++] = "-rpath";
cc_params[cc_par_cnt++] = libdir; cc_params[cc_par_cnt++] = libdir;
} else } else {
free(libdir); free(libdir);
}
/* Detect stray -v calls from ./configure scripts. */ /* Detect stray -v calls from ./configure scripts. */
while (--argc) { while (--argc) {

View File

@ -127,7 +127,7 @@ static inline TranslationBlock *tb_find(CPUState *, TranslationBlock *, int,
uint32_t); uint32_t);
static inline void tb_add_jump(TranslationBlock *tb, int n, static inline void tb_add_jump(TranslationBlock *tb, int n,
TranslationBlock *tb_next); TranslationBlock *tb_next);
int open_self_maps(void *cpu_env, int fd); int open_self_maps(void *cpu_env, int fd);
/************************* /*************************
* ACTUAL IMPLEMENTATION * * ACTUAL IMPLEMENTATION *

View File

@ -865,7 +865,8 @@ int main(int argc, char **argv_orig, char **envp) {
} }
stdin_file = alloc_printf("%s/.afl-showmap-temp-%u", use_dir, (u32)getpid()); stdin_file =
alloc_printf("%s/.afl-showmap-temp-%u", use_dir, (u32)getpid());
unlink(stdin_file); unlink(stdin_file);
atexit(at_exit_handler); atexit(at_exit_handler);
fsrv->out_fd = open(stdin_file, O_RDWR | O_CREAT | O_EXCL, 0600); fsrv->out_fd = open(stdin_file, O_RDWR | O_CREAT | O_EXCL, 0600);