Skip to content

Commit 029e039

Browse files
committed
code format
1 parent 1416fea commit 029e039

16 files changed

+53
-44
lines changed

.custom-format.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
# string_re = re.compile('(\\"(\\\\.|[^"\\\\])*\\")') # TODO: for future use
2626

27-
CURRENT_LLVM = os.getenv('LLVM_VERSION', 14)
27+
CURRENT_LLVM = os.getenv('LLVM_VERSION', 15)
2828
CLANG_FORMAT_BIN = os.getenv("CLANG_FORMAT_BIN", "")
2929

3030

frida_mode/src/lib/lib_apple.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ static gboolean lib_get_main_module(const GumModuleDetails *details,
1717

1818
GumDarwinModule **ret = (GumDarwinModule **)user_data;
1919
GumDarwinModule *module = gum_darwin_module_new_from_memory(
20-
details->path, mach_task_self(), details->range->base_address,
21-
GUM_DARWIN_MODULE_FLAGS_NONE, NULL);
20+
details->path, mach_task_self(), details->range->base_address,
21+
GUM_DARWIN_MODULE_FLAGS_NONE, NULL);
2222

2323
FVERBOSE("Found main module: %s", module->name);
2424

include/config.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
will be kept and written to the crash/ directory as RECORD:... files.
8282
Note that every crash will be written, not only unique ones! */
8383

84-
//#define AFL_PERSISTENT_RECORD
84+
// #define AFL_PERSISTENT_RECORD
8585

8686
/* console output colors: There are three ways to configure its behavior
8787
* 1. default: colored outputs fixed on: defined USE_COLOR && defined

instrumentation/SanitizerCoverageLTO.so.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1478,8 +1478,8 @@ GlobalVariable *ModuleSanitizerCoverageLTO::CreateFunctionLocalArrayInSection(
14781478

14791479
ArrayType *ArrayTy = ArrayType::get(Ty, NumElements);
14801480
auto Array = new GlobalVariable(
1481-
*CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
1482-
Constant::getNullValue(ArrayTy), "__sancov_gen_");
1481+
*CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
1482+
Constant::getNullValue(ArrayTy), "__sancov_gen_");
14831483

14841484
#if LLVM_VERSION_MAJOR >= 13
14851485
if (TargetTriple.supportsCOMDAT() &&

instrumentation/SanitizerCoveragePCGUARD.so.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,8 +714,8 @@ GlobalVariable *ModuleSanitizerCoverageAFL::CreateFunctionLocalArrayInSection(
714714

715715
ArrayType *ArrayTy = ArrayType::get(Ty, NumElements);
716716
auto Array = new GlobalVariable(
717-
*CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
718-
Constant::getNullValue(ArrayTy), "__sancov_gen_");
717+
*CurModule, ArrayTy, false, GlobalVariable::PrivateLinkage,
718+
Constant::getNullValue(ArrayTy), "__sancov_gen_");
719719

720720
#if LLVM_VERSION_MAJOR >= 13
721721
if (TargetTriple.supportsCOMDAT() &&

instrumentation/afl-compiler-rt.o.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -544,12 +544,12 @@ static void __afl_map_shm(void) {
544544

545545
if (__afl_map_size && __afl_map_size > MAP_SIZE) {
546546

547-
u8 *map_env = (u8 *)getenv("AFL_MAP_SIZE");
548-
if (!map_env || atoi((char *)map_env) < MAP_SIZE) {
547+
u8 *map_env = (u8 *)getenv("AFL_MAP_SIZE");
548+
if (!map_env || atoi((char *)map_env) < MAP_SIZE) {
549549

550-
fprintf(stderr, "FS_ERROR_MAP_SIZE\n");
551-
send_forkserver_error(FS_ERROR_MAP_SIZE);
552-
_exit(1);
550+
fprintf(stderr, "FS_ERROR_MAP_SIZE\n");
551+
send_forkserver_error(FS_ERROR_MAP_SIZE);
552+
_exit(1);
553553

554554
}
555555

@@ -561,13 +561,13 @@ static void __afl_map_shm(void) {
561561

562562
if (!__afl_area_ptr || __afl_area_ptr == (void *)-1) {
563563

564-
if (__afl_map_addr)
564+
if (__afl_map_addr)
565565
send_forkserver_error(FS_ERROR_MAP_ADDR);
566566
else
567567
send_forkserver_error(FS_ERROR_SHMAT);
568568

569569
perror("shmat for map");
570-
_exit(1);
570+
_exit(1);
571571

572572
}
573573

instrumentation/afl-llvm-lto-instrumentlist.so.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
#include "llvm/IR/Module.h"
4646
#include "llvm/Pass.h"
4747
#include "llvm/Support/Debug.h"
48-
//#include "llvm/Transforms/IPO/PassManagerBuilder.h"
48+
// #include "llvm/Transforms/IPO/PassManagerBuilder.h"
4949
#include "llvm/Passes/PassPlugin.h"
5050
#include "llvm/Passes/PassBuilder.h"
5151
#include "llvm/IR/PassManager.h"

instrumentation/cmplog-routines-pass.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
542542
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
543543
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
544544
Value *v3Pbitcast = IRB.CreateBitCast(
545-
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
545+
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
546546
Value *v3Pcasted =
547547
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
548548
args.push_back(v1Pcasted);
@@ -608,7 +608,7 @@ bool CmpLogRoutines::hookRtns(Module &M) {
608608
Value *v1Pcasted = IRB.CreatePointerCast(v1P, i8PtrTy);
609609
Value *v2Pcasted = IRB.CreatePointerCast(v2P, i8PtrTy);
610610
Value *v3Pbitcast = IRB.CreateBitCast(
611-
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
611+
v3P, IntegerType::get(C, v3P->getType()->getPrimitiveSizeInBits()));
612612
Value *v3Pcasted =
613613
IRB.CreateIntCast(v3Pbitcast, IntegerType::get(C, 64), false);
614614
args.push_back(v1Pcasted);

instrumentation/compare-transform-pass.so.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ bool CompareTransform::transformCmps(Module &M, const bool processStrcmp,
623623

624624
IRBuilder<> cur_lenchk_IRB(&*(cur_lenchk_bb->getFirstInsertionPt()));
625625
Value *icmp = cur_lenchk_IRB.CreateICmpEQ(
626-
sizedValue, ConstantInt::get(sizedValue->getType(), i));
626+
sizedValue, ConstantInt::get(sizedValue->getType(), i));
627627
cur_lenchk_IRB.CreateCondBr(icmp, end_bb, cur_cmp_bb);
628628
cur_lenchk_bb->getTerminator()->eraseFromParent();
629629

instrumentation/split-compares-pass.so.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ using namespace llvm;
6060

6161
// uncomment this toggle function verification at each step. horribly slow, but
6262
// helps to pinpoint a potential problem in the splitting code.
63-
//#define VERIFY_TOO_MUCH 1
63+
// #define VERIFY_TOO_MUCH 1
6464

6565
namespace {
6666

qemu_mode/libcompcov/libcompcov.so.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,11 @@ static int debug_fd = -1;
6868

6969
#define MAX_MAPPINGS 1024
7070

71-
static struct mapping { void *st, *en; } __compcov_ro[MAX_MAPPINGS];
71+
static struct mapping {
72+
73+
void *st, *en;
74+
75+
} __compcov_ro[MAX_MAPPINGS];
7276

7377
static u32 __compcov_ro_cnt;
7478

src/afl-cc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -933,10 +933,10 @@ static void edit_params(u32 argc, char **argv, char **envp) {
933933

934934
}
935935

936-
//#if LLVM_MAJOR >= 13
937-
// // Use the old pass manager in LLVM 14 which the AFL++ passes still
938-
// use. cc_params[cc_par_cnt++] = "-flegacy-pass-manager";
939-
//#endif
936+
// #if LLVM_MAJOR >= 13
937+
// // Use the old pass manager in LLVM 14 which the AFL++ passes still
938+
// use. cc_params[cc_par_cnt++] = "-flegacy-pass-manager";
939+
// #endif
940940

941941
if (lto_mode && !have_c) {
942942

src/afl-fuzz-redqueen.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@
2828
#include "afl-fuzz.h"
2929
#include "cmplog.h"
3030

31-
//#define _DEBUG
32-
//#define CMPLOG_INTROSPECTION
31+
// #define _DEBUG
32+
// #define CMPLOG_INTROSPECTION
3333

3434
// CMP attribute enum
3535
enum {
@@ -571,7 +571,7 @@ static u8 its_fuzz(afl_state_t *afl, u8 *buf, u32 len, u8 *status) {
571571

572572
}
573573

574-
//#ifdef CMPLOG_SOLVE_TRANSFORM
574+
// #ifdef CMPLOG_SOLVE_TRANSFORM
575575
static int strntoll(const char *str, size_t sz, char **end, int base,
576576
long long *out) {
577577

@@ -771,7 +771,7 @@ static void to_base64(u8 *src, u8 *dst, u32 dst_len) {
771771

772772
#endif
773773

774-
//#endif
774+
// #endif
775775

776776
static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
777777
u64 pattern, u64 repl, u64 o_pattern,
@@ -803,8 +803,8 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
803803
// o_pattern, pattern, repl, changed_val, idx, taint_len,
804804
// hshape, attr);
805805

806-
//#ifdef CMPLOG_SOLVE_TRANSFORM
807-
// reverse atoi()/strnu?toll() is expensive, so we only to it in lvl 3
806+
// #ifdef CMPLOG_SOLVE_TRANSFORM
807+
// reverse atoi()/strnu?toll() is expensive, so we only to it in lvl 3
808808
if (afl->cmplog_enable_transform && (lvl & LVL3)) {
809809

810810
u8 *endptr;
@@ -1120,7 +1120,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
11201120

11211121
}
11221122

1123-
//#endif
1123+
// #endif
11241124

11251125
// we only allow this for ascii2integer (above) so leave if this is the case
11261126
if (unlikely(pattern == o_pattern)) { return 0; }
@@ -1275,7 +1275,7 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
12751275
// 16 = modified float, 32 = modified integer (modified = wont match
12761276
// in original buffer)
12771277

1278-
//#ifdef CMPLOG_SOLVE_ARITHMETIC
1278+
// #ifdef CMPLOG_SOLVE_ARITHMETIC
12791279
if (!afl->cmplog_enable_arith || lvl < LVL3 || attr == IS_TRANSFORM) {
12801280

12811281
return 0;
@@ -1440,8 +1440,8 @@ static u8 cmp_extend_encoding(afl_state_t *afl, struct cmp_header *h,
14401440

14411441
}
14421442

1443-
//#endif /*
1444-
// CMPLOG_SOLVE_ARITHMETIC
1443+
// #endif /*
1444+
// CMPLOG_SOLVE_ARITHMETIC
14451445

14461446
return 0;
14471447

@@ -1948,9 +1948,9 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
19481948
#ifndef CMPLOG_COMBINE
19491949
(void)(cbuf);
19501950
#endif
1951-
//#ifndef CMPLOG_SOLVE_TRANSFORM
1952-
// (void)(changed_val);
1953-
//#endif
1951+
// #ifndef CMPLOG_SOLVE_TRANSFORM
1952+
// (void)(changed_val);
1953+
// #endif
19541954

19551955
if (afl->fsrv.total_execs - last_update > screen_update) {
19561956

@@ -2418,7 +2418,7 @@ static u8 rtn_extend_encoding(afl_state_t *afl, u8 entry,
24182418

24192419
}
24202420

2421-
//#endif
2421+
// #endif
24222422

24232423
return 0;
24242424

@@ -2818,9 +2818,9 @@ u8 input_to_state_stage(afl_state_t *afl, u8 *orig_buf, u8 *buf, u32 len) {
28182818

28192819
} else if ((lvl & LVL1)
28202820

2821-
//#ifdef CMPLOG_SOLVE_TRANSFORM
2821+
// #ifdef CMPLOG_SOLVE_TRANSFORM
28222822
|| ((lvl & LVL3) && afl->cmplog_enable_transform)
2823-
//#endif
2823+
// #endif
28242824
) {
28252825

28262826
if (unlikely(rtn_fuzz(afl, k, orig_buf, buf, cbuf, len, lvl, taint))) {

utils/afl_untracer/afl-untracer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ library_list_t *find_library(char *name) {
288288
#pragma GCC optimize("O0")
289289
void breakpoint(void) {
290290

291-
if (debug) fprintf(stderr, "Breakpoint function \"breakpoint\" reached.\n");
291+
if (debug) fprintf(stderr, "Breakpoint function \"breakpoint\" reached.\n");
292292

293293
}
294294

utils/libtokencap/libtokencap.so.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ void *(*__libc_memmem)(const void *haystack, size_t haystack_len,
8181

8282
#define MAX_MAPPINGS 1024
8383

84-
static struct mapping { void *st, *en; } __tokencap_ro[MAX_MAPPINGS];
84+
static struct mapping {
85+
86+
void *st, *en;
87+
88+
} __tokencap_ro[MAX_MAPPINGS];
8589

8690
static u32 __tokencap_ro_cnt;
8791
static u8 __tokencap_ro_loaded;

utils/socket_fuzzing/socketfuzz.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
#include <errno.h>
2424
#include <stdio.h>
2525
#include <poll.h>
26-
//#include "logging.h" // switche from preeny_info() to fprintf(stderr, "Info: "
26+
// #include "logging.h" // switched from preeny_info() to fprintf(stderr, "Info:
27+
// "
2728

2829
//
2930
// originals

0 commit comments

Comments
 (0)