From 1ee224652cb736286053ff3e7c7f52247b570dc1 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:05:39 +0200 Subject: libradamsa fix --- src/third_party/libradamsa/libradamsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index 27cf91bc..7fb5ea6d 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -1841,6 +1841,8 @@ static const unsigned char heap[] = {2,3,4,105,111,116,97,2,3,7,112,97,116,116,1 #include #include +#include "./radamsa.h" + #ifndef EMULTIHOP #define EMULTIHOP -1 #endif @@ -30757,7 +30759,7 @@ static void setup(int nwords, int nobjs) { memend = memstart + nwords - MEMPAD; } -int secondary(int nargs, char **argv) { +static int secondary(int nargs, char **argv) { word *prog; int rval, nobjs=0, nwords=0; find_heap(&nargs, &argv, &nobjs, &nwords); -- cgit 1.4.1 From ede3545d8bf9b29e6dbf590ba9986be1472faed3 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:25:02 +0200 Subject: missing-decls reremoved --- GNUmakefile | 3 ++- src/third_party/libradamsa/libradamsa.c | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/GNUmakefile b/GNUmakefile index 5657f9a7..2a76fd85 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,9 +69,10 @@ ifneq "$(shell uname -m)" "x86_64" endif CFLAGS ?= -O3 -funroll-loops $(CFLAGS_OPT) -override CFLAGS += -Wall -g -Wno-pointer-sign -Wmissing-declarations \ +override CFLAGS += -Wall -g -Wno-pointer-sign \ -I include/ -Werror -DAFL_PATH=\"$(HELPER_PATH)\" \ -DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" +# -Wmissing-declarations AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c) diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index 7fb5ea6d..b40e5670 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -30789,7 +30789,7 @@ void radamsa_init(void) { } /* bvec → value library call test with preserved state */ -word library_call(word val) { +static word library_call(word val) { word program_state = state; word res; state = IFALSE; @@ -30800,7 +30800,7 @@ word library_call(word val) { return res; } -size_t list_length(word lispval) { +static size_t list_length(word lispval) { size_t l = 0; while(lispval != INULL) { lispval = G(lispval, 2); @@ -30809,7 +30809,7 @@ size_t list_length(word lispval) { return l; } -size_t copy_list(uint8_t *ptr, word lispval, size_t max) { +static size_t copy_list(uint8_t *ptr, word lispval, size_t max) { size_t n = 0; while(pairp((word)lispval) && max-- && lispval != INULL) { *ptr++ = 255 & immval(G(lispval, 1)); // *ptr++ = car(list) -- cgit 1.4.1 From 94187837c799bd712e68890b4466abb6f52079ad Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:37:33 +0200 Subject: removed unused functions --- GNUmakefile | 3 +-- src/third_party/libradamsa/libradamsa.c | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/GNUmakefile b/GNUmakefile index 2a76fd85..11dfa803 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -69,10 +69,9 @@ ifneq "$(shell uname -m)" "x86_64" endif CFLAGS ?= -O3 -funroll-loops $(CFLAGS_OPT) -override CFLAGS += -Wall -g -Wno-pointer-sign \ +override CFLAGS += -Wall -g -Wno-pointer-sign -Wmissing-declarations\ -I include/ -Werror -DAFL_PATH=\"$(HELPER_PATH)\" \ -DBIN_PATH=\"$(BIN_PATH)\" -DDOC_PATH=\"$(DOC_PATH)\" -# -Wmissing-declarations AFL_FUZZ_FILES = $(wildcard src/afl-fuzz*.c) diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index b40e5670..5de597ff 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -30758,7 +30758,7 @@ static void setup(int nwords, int nobjs) { exit(4); memend = memstart + nwords - MEMPAD; } - +/* static int secondary(int nargs, char **argv) { word *prog; int rval, nobjs=0, nwords=0; @@ -30774,6 +30774,7 @@ static int secondary(int nargs, char **argv) { } return 127; } +*/ void radamsa_init(void) { int nobjs=0, nwords=0; @@ -30800,6 +30801,7 @@ static word library_call(word val) { return res; } +/* static size_t list_length(word lispval) { size_t l = 0; while(lispval != INULL) { @@ -30808,6 +30810,7 @@ static size_t list_length(word lispval) { } return l; } +*/ static size_t copy_list(uint8_t *ptr, word lispval, size_t max) { size_t n = 0; -- cgit 1.4.1 From 872d1c1d98f311ab9b2f94773e724ba9c8af5205 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:47:53 +0200 Subject: less radamsa --- src/third_party/libradamsa/libradamsa.c | 36 ++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index 5de597ff..7ad4044b 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -30707,23 +30707,23 @@ static void read_heap(const char *path) { } /* find a fasl image source to *hp or exit */ -static void find_heap(int *nargs, char ***argv, int *nobjs, int *nwords) { - file_heap = NULL; - if ((word)heap == 0) { +//static void find_heap(int *nargs, char ***argv, int *nobjs, int *nwords) { +// file_heap = NULL; +// if ((word)heap == 0) { /* if no preloaded heap, try to load it from first vm arg */ - if (*nargs < 2) - exit(1); - read_heap(argv[0][1]); - ++*argv; - --*nargs; - hp = file_heap; - if (*hp == '#') - while (*hp++ != '\n'); - } else { - hp = heap; /* builtin heap */ - } - heap_metrics(nwords, nobjs); -} +// if (*nargs < 2) +// exit(1); +// read_heap(argv[0][1]); +// ++*argv; +// --*nargs; +// hp = file_heap; +// if (*hp == '#') +// while (*hp++ != '\n'); +// } else { +// hp = heap; /* builtin heap */ +// } +// heap_metrics(nwords, nobjs); +//} static word *decode_fasl(uint nobjs) { word *ptrs; @@ -30746,7 +30746,7 @@ static word *load_heap(uint nobjs) { free(file_heap); return entry; } - +/* static void setup(int nwords, int nobjs) { tcgetattr(0, &tsettings); state = IFALSE; @@ -30758,7 +30758,7 @@ static void setup(int nwords, int nobjs) { exit(4); memend = memstart + nwords - MEMPAD; } -/* + static int secondary(int nargs, char **argv) { word *prog; int rval, nobjs=0, nwords=0; -- cgit 1.4.1 From 5e53002303820ef2ab32f411993907c92ef9f0b9 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:48:40 +0200 Subject: less radamsa --- src/third_party/libradamsa/libradamsa.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index 7ad4044b..72c8fde6 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -2178,7 +2178,7 @@ static uint llen(word *ptr) { } return len; } - +/* static void set_signal_handler(void) { struct sigaction sa; sa.sa_handler = signal_handler; @@ -2187,7 +2187,7 @@ static void set_signal_handler(void) { sigaction(SIGINT, &sa, NULL); sigaction(SIGPIPE, &sa, NULL); } - +*/ static word mkpair(word h, word a, word d) { word *pair; allocate(3, pair); @@ -30685,7 +30685,7 @@ static void heap_metrics(int *rwords, int *rnobjs) { get_obj_metrics(rwords, rnobjs); hp = hp_start; } - +/* static void read_heap(const char *path) { struct stat st; off_t pos = 0; @@ -30705,6 +30705,7 @@ static void read_heap(const char *path) { } while (n && (pos += n) < st.st_size); close(fd); } +*/ /* find a fasl image source to *hp or exit */ //static void find_heap(int *nargs, char ***argv, int *nobjs, int *nwords) { -- cgit 1.4.1 From 380ff114e9a369c6b366c40a146eed37602d2620 Mon Sep 17 00:00:00 2001 From: Dominik Maier Date: Thu, 16 Apr 2020 16:51:23 +0200 Subject: the least radamsa --- src/third_party/libradamsa/libradamsa.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/third_party/libradamsa/libradamsa.c') diff --git a/src/third_party/libradamsa/libradamsa.c b/src/third_party/libradamsa/libradamsa.c index 72c8fde6..4f5515e5 100644 --- a/src/third_party/libradamsa/libradamsa.c +++ b/src/third_party/libradamsa/libradamsa.c @@ -2157,17 +2157,17 @@ static word *gc(int size, word *regs) { /*** OS Interaction and Helpers ***/ -static void signal_handler(int signal) { - switch (signal) { - case SIGINT: - breaked |= 2; - break; - case SIGPIPE: - break; /* can cause loop when reporting errors */ - default: - breaked |= 4; - } -} +//static void signal_handler(int signal) { +// switch (signal) { +// case SIGINT: +// breaked |= 2; +// break; +// case SIGPIPE: +// break; /* can cause loop when reporting errors */ +// default: +// breaked |= 4; +// } +//} /* list length, no overflow or valid termination checks */ static uint llen(word *ptr) { -- cgit 1.4.1