Browse Source

Attempt to remove rand stuff from dc fuzzing

pull/5/head
Gavin Howard 11 months ago
parent
commit
6594d1400f
Signed by: gavin GPG Key ID: C08038BDF280D33E
  1. 4
      include/dc.h
  2. 4
      release.sh
  3. 24
      src/data.c

4
include/dc.h

@ -36,6 +36,10 @@
#ifndef BC_DC_H
#define BC_DC_H
#ifndef DC_ENABLE_RAND
#define DC_ENABLE_RAND (1)
#endif // DC_ENABLE_RAND
#if DC_ENABLED
#include <status.h>

4
release.sh

@ -513,7 +513,7 @@ if [ "$run_tests" -ne 0 ]; then
header "Configuring for afl-gcc..."
configure "$debug $gcc_flags" "afl-gcc" "-HNP -gO3" "1" "$bits"
configure "$debug $gcc_flags -DDC_ENABLE_RAND=0" "afl-gcc" "-HNP -gO3" "1" "$bits"
printf '\n'
printf 'Run make\n'
@ -522,7 +522,7 @@ if [ "$run_tests" -ne 0 ]; then
printf '\n'
printf 'Then run ASan on the fuzzer test cases with the following build:\n'
printf '\n'
printf ' CFLAGS="-fsanitize=address -fno-omit-frame-pointer" ./configure.sh -gO3 -HNPS\n'
printf ' CFLAGS="-fsanitize=address -fno-omit-frame-pointer -DDC_ENABLE_RAND=0" ./configure.sh -gO3 -HNPS\n'
printf ' make\n'
printf '\n'
printf 'Then run the GitHub release script as follows:\n'

24
src/data.c

@ -779,11 +779,11 @@ const uint8_t dc_lex_regs[] = {
const size_t dc_lex_regs_len = sizeof(dc_lex_regs) / sizeof(uint8_t);
const uchar dc_lex_tokens[] = {
#if BC_ENABLE_EXTRA_MATH
#if BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_KW_IRAND,
#else // BC_ENABLE_EXTRA_MATH
#else // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
#endif // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_INVALID,
#if BC_ENABLE_EXTRA_MATH
BC_LEX_OP_TRUNC,
@ -791,11 +791,11 @@ const uchar dc_lex_tokens[] = {
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
BC_LEX_OP_MODULUS, BC_LEX_INVALID,
#if BC_ENABLE_EXTRA_MATH
#if BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_KW_RAND,
#else // BC_ENABLE_EXTRA_MATH
#else // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
#endif // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_LPAREN, BC_LEX_RPAREN, BC_LEX_OP_MULTIPLY, BC_LEX_OP_PLUS,
BC_LEX_INVALID, BC_LEX_OP_MINUS, BC_LEX_INVALID, BC_LEX_OP_DIVIDE,
BC_LEX_INVALID, BC_LEX_INVALID, BC_LEX_INVALID, BC_LEX_INVALID,
@ -816,20 +816,20 @@ const uchar dc_lex_tokens[] = {
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
BC_LEX_KW_IBASE,
#if BC_ENABLE_EXTRA_MATH
#if BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_KW_SEED,
#else // BC_ENABLE_EXTRA_MATH
#else // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
#endif // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_KW_SCALE, BC_LEX_LOAD_POP, BC_LEX_OP_BOOL_AND, BC_LEX_OP_BOOL_NOT,
BC_LEX_KW_OBASE, BC_LEX_PRINT_STREAM, BC_LEX_NQUIT, BC_LEX_POP,
BC_LEX_STORE_PUSH, BC_LEX_KW_MAXIBASE, BC_LEX_KW_MAXOBASE,
BC_LEX_KW_MAXSCALE,
#if BC_ENABLE_EXTRA_MATH
#if BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_KW_MAXRAND,
#else // BC_ENABLE_EXTRA_MATH
#else // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_INVALID,
#endif // BC_ENABLE_EXTRA_MATH
#endif // BC_ENABLE_EXTRA_MATH && DC_ENABLE_RAND
BC_LEX_SCALE_FACTOR,
BC_LEX_INVALID, BC_LEX_KW_LENGTH, BC_LEX_INVALID, BC_LEX_INVALID,
BC_LEX_INVALID, BC_LEX_OP_POWER, BC_LEX_NEG, BC_LEX_INVALID,

Loading…
Cancel
Save