diff options
Diffstat (limited to 'contrib')
320 files changed, 6246 insertions, 712 deletions
diff --git a/contrib/bc/.gitignore b/contrib/bc/.gitignore index fb9bc5ab6aa2..5c2bbae866c0 100644 --- a/contrib/bc/.gitignore +++ b/contrib/bc/.gitignore @@ -34,6 +34,13 @@ config.mak timeconst.bc Makefile +tests/fuzzing/bc_outputs1/* +tests/fuzzing/bc_outputs2/* +tests/fuzzing/bc_outputs3/* +tests/fuzzing/dc_outputs/* +tests/bc_outputs/* +tests/dc_outputs/* + .gdb_history # Ignore the generated test files @@ -57,5 +64,7 @@ perf.data.old *.html *.profraw +core.* + cscope*.out tags diff --git a/contrib/bc/LICENSE.md b/contrib/bc/LICENSE.md index 1681a053e0de..269e131cc81d 100644 --- a/contrib/bc/LICENSE.md +++ b/contrib/bc/LICENSE.md @@ -1,6 +1,6 @@ # License -Copyright (c) 2018-2020 Gavin D. Howard <yzena.tech@gmail.com> +Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -31,7 +31,7 @@ copyrights and license: Copyright (c) 2010-2014, Salvatore Sanfilippo <antirez at gmail dot com><br> Copyright (c) 2010-2013, Pieter Noordhuis <pcnoordhuis at gmail dot com><br> Copyright (c) 2018 rain-1 <rain1@openmailbox.org><br> -Copyright (c) 2018-2020, Gavin D. Howard <yzena.tech@gmail.com> +Copyright (c) 2018-2021, Gavin D. Howard <yzena.tech@gmail.com> Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -53,3 +53,51 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +## Rand + +The files `src/rand.c` and `include/rand.h` are under the following copyrights +and license: + +Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors +Copyright (c) 2018-2021 Gavin D. Howard <yzena.tech@gmail.com> + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +## `safe-install.sh` + +The file `safe-install.sh` is under the following copyright and license: + +Copyright (c) 2021 Rich Felker + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Softwareâ€), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS ISâ€, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/contrib/bc/Makefile.in b/contrib/bc/Makefile.in index d17e74163397..8ae982bd99fe 100644 --- a/contrib/bc/Makefile.in +++ b/contrib/bc/Makefile.in @@ -1,7 +1,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -29,7 +29,7 @@ # .POSIX: -VERSION = 3.2.4 +VERSION = 3.2.6 SRC = %%SRC%% OBJ = %%OBJ%% @@ -41,6 +41,13 @@ BC_ENABLED = %%BC_ENABLED%% DC_ENABLED_NAME = DC_ENABLED DC_ENABLED = %%DC_ENABLED%% +HEADERS = include/args.h include/file.h include/lang.h include/lex.h include/num.h include/opt.h include/parse.h include/program.h include/read.h include/status.h include/vector.h include/vm.h +BC_HEADERS = include/bc.h +DC_HEADERS = include/dc.h +HISTORY_HEADERS = include/history.h +EXTRA_MATH_HEADERS = include/rand.h +LIBRARY_HEADERS = include/bcl.h include/library.h + GEN_DIR = gen GEN = %%GEN%% GEN_EXEC = $(GEN_DIR)/$(GEN) @@ -82,6 +89,11 @@ DC = dc BC_EXEC = $(BIN)/$(EXEC_PREFIX)$(BC) DC_EXEC = $(BIN)/$(EXEC_PREFIX)$(DC) +BC_TEST_OUTPUTS = tests/bc_outputs +BC_FUZZ_OUTPUTS = tests/fuzzing/bc_outputs1 tests/fuzzing/bc_outputs2 tests/fuzzing/bc_outputs3 +DC_TEST_OUTPUTS = tests/dc_outputs +DC_FUZZ_OUTPUTS = tests/fuzzing/dc_outputs + LIB = libbcl LIB_NAME = $(LIB).a LIBBC = $(BIN)/$(LIB_NAME) @@ -125,6 +137,9 @@ BC_ENABLE_NLS = %%NLS%% BC_ENABLE_PROMPT = %%PROMPT%% BC_LONG_BIT = %%LONG_BIT%% +BC_ENABLE_AFL = %%FUZZ%% +BC_ENABLE_MEMCHECK = %%MEMCHECK%% + RM = rm MKDIR = mkdir @@ -138,6 +153,8 @@ LOCALE_UNINSTALL = ./locale_uninstall.sh VALGRIND_ARGS = --error-exitcode=100 --leak-check=full --show-leak-kinds=all --errors-for-leak-kinds=all +TEST_STARS = "***********************************************************************" + BC_NUM_KARATSUBA_LEN = %%KARATSUBA_LEN%% CPPFLAGS1 = -D$(BC_ENABLED_NAME)=$(BC_ENABLED) -D$(DC_ENABLED_NAME)=$(DC_ENABLED) @@ -147,7 +164,8 @@ CPPFLAGS4 = $(CPPFLAGS3) -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 CPPFLAGS5 = $(CPPFLAGS4) -DBC_NUM_KARATSUBA_LEN=$(BC_NUM_KARATSUBA_LEN) CPPFLAGS6 = $(CPPFLAGS5) -DBC_ENABLE_NLS=$(BC_ENABLE_NLS) -DBC_ENABLE_PROMPT=$(BC_ENABLE_PROMPT) CPPFLAGS7 = $(CPPFLAGS6) -D$(BC_ENABLE_EXTRA_MATH_NAME)=$(BC_ENABLE_EXTRA_MATH) -CPPFLAGS = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS8 = $(CPPFLAGS7) -DBC_ENABLE_HISTORY=$(BC_ENABLE_HISTORY) -DBC_ENABLE_LIBRARY=$(BC_ENABLE_LIBRARY) +CPPFLAGS = $(CPPFLAGS8) -DBC_ENABLE_MEMCHECK=$(BC_ENABLE_MEMCHECK) -DBC_ENABLE_AFL=$(BC_ENABLE_AFL) CFLAGS = $(CPPFLAGS) %%CPPFLAGS%% %%CFLAGS%% LDFLAGS = %%LDFLAGS%% @@ -159,20 +177,15 @@ HOSTCC = %%HOSTCC%% BC_LIB_C_ARGS = bc_lib bc_lib_name $(BC_ENABLED_NAME) 1 BC_LIB2_C_ARGS = bc_lib2 bc_lib2_name "$(BC_ENABLED_NAME) && $(BC_ENABLE_EXTRA_MATH_NAME)" 1 -OBJS = $(BC_HELP_O) $(DC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -OBJ_TARGETS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +OBJS = $(DC_HELP_O) $(BC_HELP_O) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) -.c.o: - $(CC) $(CFLAGS) -o $@ -c $< - -all: %%ALL_PREREQ%% +all: %%DEFAULT_TARGET%% -execs: make_bin $(OBJ_TARGETS) - $(CC) $(CFLAGS) $(OBJS) $(LDFLAGS) -o $(EXEC) - %%LINK%% +%%DEFAULT_TARGET%%: %%DEFAULT_TARGET_PREREQS%% + %%DEFAULT_TARGET_CMD%% -library: make_bin $(OBJ) $(BC_LIB_O) $(BC_LIB2_O) - ar -r -cu $(LIBBC) $(BC_LIB_O) $(BC_LIB2_O) $(OBJ) +%%SECOND_TARGET%%: %%SECOND_TARGET_PREREQS%% + %%SECOND_TARGET_CMD%% $(GEN_EXEC): %%GEN_EXEC_TARGET%% @@ -180,18 +193,32 @@ $(GEN_EXEC): $(BC_LIB_C): $(GEN_EXEC) $(BC_LIB) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB) $(BC_LIB_C) $(BC_LIB_C_ARGS) +$(BC_LIB_O): $(BC_LIB_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_LIB2_C): $(GEN_EXEC) $(BC_LIB2) $(GEN_EMU) $(GEN_EXEC) $(BC_LIB2) $(BC_LIB2_C) $(BC_LIB2_C_ARGS) +$(BC_LIB2_O): $(BC_LIB2_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(BC_HELP_C): $(GEN_EXEC) $(BC_HELP) $(GEN_EMU) $(GEN_EXEC) $(BC_HELP) $(BC_HELP_C) bc_help "" $(BC_ENABLED_NAME) +$(BC_HELP_O): $(BC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + $(DC_HELP_C): $(GEN_EXEC) $(DC_HELP) $(GEN_EMU) $(GEN_EXEC) $(DC_HELP) $(DC_HELP_C) dc_help "" $(DC_ENABLED_NAME) -make_bin: +$(DC_HELP_O): $(DC_HELP_C) + $(CC) $(CFLAGS) -o $@ -c $< + +$(BIN): $(MKDIR) -p $(BIN) +headers: %%HEADERS%% + help: @printf 'available targets:\n' @printf '\n' @@ -222,41 +249,68 @@ help: @printf ' valgrind_dc runs the dc test suite, if dc has been built,\n' @printf ' through valgrind\n' +run_all_tests: + %%BC_ALL_TESTS%% + %%TIMECONST_ALL_TESTS%% + %%DC_ALL_TESTS%% + check: test test: %%TESTS%% -test_bc: - %%BC_TEST%% +test_bc: test_bc_header test_bc_tests test_bc_scripts test_bc_stdin test_bc_read test_bc_errors test_bc_other + @printf '\nAll bc tests passed.\n\n$(TEST_STARS)\n' + +test_bc_tests:%%BC_TESTS%% + +test_bc_scripts:%%BC_SCRIPT_TESTS%% + +test_bc_stdin: + @sh tests/stdin.sh bc %%BC_TEST_EXEC%% + +test_bc_read: + @sh tests/read.sh bc %%BC_TEST_EXEC%% + +test_bc_errors: + @sh tests/errors.sh bc %%BC_TEST_EXEC%% + +test_bc_other: + @sh tests/other.sh bc %%BC_TEST_EXEC%% + +test_bc_header: + @printf '$(TEST_STARS)\n\nRunning bc tests...\n\n' -test_dc: - %%DC_TEST%% +test_dc: test_dc_header test_dc_tests test_dc_scripts test_dc_stdin test_dc_read test_dc_errors test_dc_other + @printf '\nAll dc tests passed.\n\n$(TEST_STARS)\n' -time_test: time_test_bc timeconst time_test_dc +test_dc_tests:%%DC_TESTS%% -time_test_bc: - %%BC_TIME_TEST%% +test_dc_scripts:%%DC_SCRIPT_TESTS%% -time_test_dc: - %%DC_TIME_TEST%% +test_dc_stdin: + @sh tests/stdin.sh dc %%DC_TEST_EXEC%% + +test_dc_read: + @sh tests/read.sh dc %%DC_TEST_EXEC%% + +test_dc_errors: + @sh tests/errors.sh dc %%DC_TEST_EXEC%% + +test_dc_other: + @sh tests/other.sh dc %%DC_TEST_EXEC%% + +test_dc_header: + @printf '$(TEST_STARS)\n\nRunning dc tests...\n\n' timeconst: %%TIMECONST%% -library_test: library +library_test: $(LIBBC) $(CC) $(CFLAGS) $(BCL_TEST_C) $(LIBBC) -o $(BCL_TEST) test_library: library_test $(BCL_TEST) -valgrind: valgrind_bc valgrind_dc - -valgrind_bc: - %%VG_BC_TEST%% - -valgrind_dc: - %%VG_DC_TEST%% - karatsuba: %%KARATSUBA%% @@ -296,6 +350,8 @@ clean:%%CLEAN_PREREQS%% @$(RM) -f $(BC_LIB2_C) $(BC_LIB2_O) @$(RM) -f $(BC_HELP_C) $(BC_HELP_O) @$(RM) -f $(DC_HELP_C) $(DC_HELP_O) + @$(RM) -fr $(BC_TEST_OUTPUTS) $(DC_TEST_OUTPUTS) + @$(RM) -fr $(BC_FUZZ_OUTPUTS) $(DC_FUZZ_OUTPUTS) clean_config: clean @printf 'Cleaning config...\n' diff --git a/contrib/bc/NEWS.md b/contrib/bc/NEWS.md index f4fc2f5779ce..5982defb754c 100644 --- a/contrib/bc/NEWS.md +++ b/contrib/bc/NEWS.md @@ -1,5 +1,40 @@ # News +## 3.2.6 + +This is a production release that fixes the build on FreeBSD. + +There was a syntax error in `configure.sh` that the Linux shell did not catch, +and FreeBSD depends on the existence of `tests/all.sh`. + +All users that already upgraded to `3.2.5` should update to this release, with +my apologies for the poor release of `3.2.5`. Other users should skip `3.2.5` in +favor of this version. + +## 3.2.5 + +This is a production release that fixes several bugs and adds a couple small +things. + +The two most important bugs were bugs that causes `dc` to access memory +out-of-bounds (crash in debug builds). This was found by upgrading to `afl++` +from `afl`. Both were caused by a failure to distinguish between the same two +cases. + +Another bug was the failure to put all of the licenses in the `LICENSE.md` file. + +Third, some warnings by `scan-build` were found and eliminated. This needed one +big change: `bc` and `dc` now bail out as fast as possible on fatal errors +instead of unwinding the stack. + +Fourth, the pseudo-random number now attempts to seed itself with `/dev/random` +if `/dev/urandom` fails. + +Finally, this release has a few quality-of-life changes to the build system. The +usage should not change at all; the only thing that changed was making sure the +`Makefile.in` was written to rebuild properly when headers changed and to not +rebuild when not necessary. + ## 3.2.4 This is a production release that fixes a warning on `gcc` 6 or older, which diff --git a/contrib/bc/NOTICE.md b/contrib/bc/NOTICE.md index 92117daa9a6c..56d2935ab4b3 100644 --- a/contrib/bc/NOTICE.md +++ b/contrib/bc/NOTICE.md @@ -1,6 +1,6 @@ # Notice -Copyright 2018-2020 Gavin D. Howard and contributors. +Copyright 2018-2021 Gavin D. Howard and contributors. ## Contributors diff --git a/contrib/bc/README.md b/contrib/bc/README.md index 6f3c3f252cbc..beda88d23f90 100644 --- a/contrib/bc/README.md +++ b/contrib/bc/README.md @@ -39,6 +39,7 @@ Systems that are known to work: * Mac OSX * Solaris* (as long as the Solaris version supports POSIX 2008) * AIX +* HP-UX* (except for history) Please submit bug reports if this `bc` does not build out of the box on any system besides Windows. If Windows binaries are needed, they can be found at diff --git a/contrib/bc/configure.sh b/contrib/bc/configure.sh index b6caf3debba3..ae1675cde97d 100755 --- a/contrib/bc/configure.sh +++ b/contrib/bc/configure.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -33,6 +33,8 @@ script=$(basename "$script") . "$scriptdir/functions.sh" +cd "$scriptdir" + usage() { if [ $# -gt 0 ]; then @@ -48,7 +50,7 @@ usage() { printf 'usage:\n' printf ' %s -h\n' "$script" printf ' %s --help\n' "$script" - printf ' %s [-a|-bD|-dB|-c] [-EfgGHlMNPT] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" + printf ' %s [-a|-bD|-dB|-c] [-CEfgGHlmMNPtTvz] [-O OPT_LEVEL] [-k KARATSUBA_LEN]\n' "$script" printf ' %s \\\n' "$script" printf ' [--library|--bc-only --disable-dc|--dc-only --disable-bc|--coverage]\\\n' printf ' [--force --debug --disable-extra-math --disable-generated-tests] \\\n' @@ -73,6 +75,8 @@ usage() { printf ' Generate test coverage code. Requires gcov and regcovr.\n' printf ' It is an error if either "-b" ("-D") or "-d" ("-B") is specified.\n' printf ' Requires a compiler that use gcc-compatible coverage options\n' + printf ' -C, --disable-clean\n' + printf ' Disable the clean that configure.sh does before configure.\n' printf ' -d, --dc-only\n' printf ' Build dc only. It is an error if "-b", "--bc-only", "-D", or\n' printf ' "--disable-dc" are specified too.\n' @@ -107,6 +111,8 @@ usage() { printf ' Installs all locales, regardless of how many are on the system. This\n' printf ' option is useful for package maintainers who want to make sure that\n' printf ' a package contains all of the locales that end users might need.\n' + printf ' -m, --enable-memcheck\n' + printf ' Enable memcheck mode, to ensure no memory leaks. For development only.\n' printf ' -M, --disable-man-pages\n' printf ' Disable installing manpages.\n' printf ' -N, --disable-nls\n' @@ -119,9 +125,15 @@ usage() { printf ' Disables the prompt in the built bc. The prompt will never show up,\n' printf ' or in other words, it will be permanently disabled and cannot be\n' printf ' enabled.\n' + printf ' -t, --enable-test-timing\n' + printf ' Enable the timing of tests. This is for development only.\n' printf ' -T, --disable-strip\n' printf ' Disable stripping symbols from the compiled binary or binaries.\n' printf ' Stripping symbols only happens when debug mode is off.\n' + printf ' -v, --enable-valgrind\n' + printf ' Enable a build appropriate for valgrind. For development only.\n' + printf ' -z, --enable-fuzz-mode\n' + printf ' Enable fuzzing mode. THIS IS FOR DEVELOPMENT ONLY.\n' printf ' --prefix PREFIX\n' printf ' The prefix to install to. Overrides "$PREFIX" if it exists.\n' printf ' If PREFIX is "/usr", install path will be "/usr/bin".\n' @@ -277,6 +289,23 @@ replace() { substring_replace "$_replace_str" "%%$_replace_needle%%" "$_replace_replacement" } +find_src_files() { + + if [ "$#" -ge 1 ] && [ "$1" != "" ]; then + + while [ "$#" -ge 1 ]; do + _find_src_files_a="${1## }" + shift + _find_src_files_args="$_find_src_files_args ! -path src/${_find_src_files_a}" + done + + else + _find_src_files_args="-print" + fi + + printf '%s\n' $(find src/ -depth -name "*.c" $_find_src_files_args) +} + gen_file_list() { if [ "$#" -lt 1 ]; then @@ -291,15 +320,9 @@ gen_file_list() { cd "$scriptdir" if [ "$#" -ge 1 ]; then - - while [ "$#" -ge 1 ]; do - a="$1" - shift - args="$args ! -path src/${a}" - done - + _gen_file_list_unneeded="$@" else - args="-print" + _gen_file_list_unneeded="" fi _gen_file_list_needle_src="SRC" @@ -307,7 +330,7 @@ gen_file_list() { _gen_file_list_needle_gcda="GCDA" _gen_file_list_needle_gcno="GCNO" - _gen_file_list_replacement=$(find src/ -depth -name "*.c" $args | tr '\n' ' ') + _gen_file_list_replacement=$(find_src_files $_gen_file_list_unneeded | tr '\n' ' ') _gen_file_list_contents=$(replace "$_gen_file_list_contents" \ "$_gen_file_list_needle_src" "$_gen_file_list_replacement") @@ -328,6 +351,101 @@ gen_file_list() { printf '%s\n' "$_gen_file_list_contents" } +gen_tests() { + + _gen_tests_name="$1" + shift + + _gen_tests_uname="$1" + shift + + _gen_tests_extra_math="$1" + shift + + _gen_tests_time_tests="$1" + shift + + _gen_tests_extra_required=$(cat tests/extra_required.txt) + + for _gen_tests_t in $(cat "$scriptdir/tests/$_gen_tests_name/all.txt"); do + + if [ "$_gen_tests_extra_math" -eq 0 ]; then + + if [ -z "${_gen_tests_extra_required##*$_gen_tests_t*}" ]; then + printf 'test_%s_%s:\n\t@printf "Skipping %s %s\\n"\n\n' \ + "$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \ + "$_gen_tests_t" >> "$scriptdir/Makefile" + continue + fi + + fi + + printf 'test_%s_%s:\n\t@sh tests/test.sh %s %s %s %s %s\n\n' \ + "$_gen_tests_name" "$_gen_tests_t" "$_gen_tests_name" \ + "$_gen_tests_t" "$generate_tests" "$time_tests" \ + "$*" >> "$scriptdir/Makefile" + + done +} + +gen_test_targets() { + + _gen_test_targets_name="$1" + shift + + _gen_test_targets_tests=$(cat "$scriptdir/tests/${_gen_test_targets_name}/all.txt") + + for _gen_test_targets_t in $_gen_test_targets_tests; do + printf ' test_%s_%s' "$_gen_test_targets_name" "$_gen_test_targets_t" + done + + printf '\n' +} + +gen_script_tests() { + + _gen_script_tests_name="$1" + shift + + _gen_script_tests_extra_math="$1" + shift + + _gen_script_tests_generate="$1" + shift + + _gen_script_tests_time="$1" + shift + + _gen_script_tests_tests=$(cat "$scriptdir/tests/$_gen_script_tests_name/scripts/all.txt") + + for _gen_script_tests_f in $_gen_script_tests_tests; do + + _gen_script_tests_b=$(basename "$_gen_script_tests_f" ".${_gen_script_tests_name}") + + printf 'test_%s_script_%s:\n\t@sh tests/script.sh %s %s %s 1 %s %s %s\n\n' \ + "$_gen_script_tests_name" "$_gen_script_tests_b" "$_gen_script_tests_name" \ + "$_gen_script_tests_f" "$_gen_script_tests_extra_math" "$_gen_script_tests_generate" \ + "$_gen_script_tests_time" "$*" >> "$scriptdir/Makefile" + done +} + +gen_script_test_targets() { + + _gen_script_test_targets_name="$1" + shift + + _gen_script_test_targets_tests=$(cat "$scriptdir/tests/$_gen_script_test_targets_name/scripts/all.txt") + + for _gen_script_test_targets_f in $_gen_script_test_targets_tests; do + _gen_script_test_targets_b=$(basename "$_gen_script_test_targets_f" \ + ".$_gen_script_test_targets_name") + printf ' test_%s_script_%s' "$_gen_script_test_targets_name" \ + "$_gen_script_test_targets_b" + done + + printf '\n' +} + bc_only=0 dc_only=0 coverage=0 @@ -344,14 +462,20 @@ force=0 strip_bin=1 all_locales=0 library=0 +fuzz=0 +time_tests=0 +vg=0 +memcheck=0 +clean=1 -while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do +while getopts "abBcdDEfgGhHk:lMmNO:PStTvz-" opt; do case "$opt" in a) library=1 ;; b) bc_only=1 ;; B) dc_only=1 ;; c) coverage=1 ;; + C) clean=0 ;; d) dc_only=1 ;; D) bc_only=1 ;; E) extra_math=0 ;; @@ -362,11 +486,15 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do H) hist=0 ;; k) karatsuba_len="$OPTARG" ;; l) all_locales=1 ;; + m) memcheck=1 ;; M) install_manpages=0 ;; N) nls=0 ;; O) optimization="$OPTARG" ;; P) prompt=0 ;; + t) time_tests=1 ;; T) strip_bin=0 ;; + v) vg=1 ;; + z) fuzz=1 ;; -) arg="$1" arg="${arg#--}" @@ -465,6 +593,7 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do shift ;; disable-bc) dc_only=1 ;; disable-dc) bc_only=1 ;; + disable-clean) clean=0 ;; disable-extra-math) extra_math=0 ;; disable-generated-tests) generate_tests=0 ;; disable-history) hist=0 ;; @@ -472,16 +601,24 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do disable-nls) nls=0 ;; disable-prompt) prompt=0 ;; disable-strip) strip_bin=0 ;; + enable-test-timing) time_tests=1 ;; + enable-valgrind) vg=1 ;; + enable-fuzz-mode) fuzz=1 ;; + enable-memcheck) memcheck=1 ;; install-all-locales) all_locales=1 ;; help* | bc-only* | dc-only* | coverage* | debug*) usage "No arg allowed for --$arg option" ;; - disable-bc* | disable-dc* | disable-extra-math*) + disable-bc* | disable-dc* | disable-clean*) + usage "No arg allowed for --$arg option" ;; + disable-extra-math*) usage "No arg allowed for --$arg option" ;; disable-generated-tests* | disable-history*) usage "No arg allowed for --$arg option" ;; disable-man-pages* | disable-nls* | disable-strip*) usage "No arg allowed for --$arg option" ;; - install-all-locales*) + enable-fuzz-mode* | enable-test-timing* | enable-valgrind*) + usage "No arg allowed for --$arg option" ;; + enable-memcheck* | install-all-locales*) usage "No arg allowed for --$arg option" ;; '') break ;; # "--" terminates argument processing * ) usage "Invalid option $LONG_OPTARG" ;; @@ -493,6 +630,12 @@ while getopts "abBcdDEfgGhHk:lMNO:PST-" opt; do done +if [ "$clean" -ne 0 ]; then + if [ -f ./Makefile ]; then + make clean_config > /dev/null + fi +fi + if [ "$bc_only" -eq 1 ] && [ "$dc_only" -eq 1 ]; then usage "Can only specify one of -b(-D) or -d(-B)" fi @@ -581,21 +724,19 @@ executable="BC_EXEC" tests="test_bc timeconst test_dc" bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 \$(BC_EXEC)" -bc_time_test="@tests/all.sh bc $extra_math 1 $generate_tests 1 \$(BC_EXEC)" - dc_test="@tests/all.sh dc $extra_math 1 $generate_tests 0 \$(DC_EXEC)" -dc_time_test="@tests/all.sh dc $extra_math 1 $generate_tests 1 \$(DC_EXEC)" timeconst="@tests/bc/timeconst.sh tests/bc/scripts/timeconst.bc \$(BC_EXEC)" # In order to have cleanup at exit, we need to be in # debug mode, so don't run valgrind without that. -if [ "$debug" -ne 0 ]; then - vg_bc_test="@tests/all.sh bc $extra_math 1 $generate_tests 0 valgrind \$(VALGRIND_ARGS) \$(BC_EXEC)" - vg_dc_test="@tests/all.sh dc $extra_math 1 $generate_tests 0 valgrind \$(VALGRIND_ARGS) \$(DC_EXEC)" +if [ "$vg" -ne 0 ]; then + debug=1 + bc_test_exec='valgrind $(VALGRIND_ARGS) $(BC_EXEC)' + dc_test_exec='valgrind $(VALGRIND_ARGS) $(DC_EXEC)' else - vg_bc_test="@printf 'Cannot run valgrind without debug flags\\\\n'" - vg_dc_test="@printf 'Cannot run valgrind without debug flags\\\\n'" + bc_test_exec='$(BC_EXEC)' + dc_test_exec='$(DC_EXEC)' fi karatsuba="@printf 'karatsuba cannot be run because one of bc or dc is not built\\\\n'" @@ -605,7 +746,29 @@ bc_lib="\$(GEN_DIR)/lib.o" bc_help="\$(GEN_DIR)/bc_help.o" dc_help="\$(GEN_DIR)/dc_help.o" -if [ "$bc_only" -eq 1 ]; then +default_target_prereqs="\$(BIN) \$(OBJS)" +default_target_cmd="\$(CC) \$(CFLAGS) \$(OBJS) \$(LDFLAGS) -o \$(EXEC)" +default_target="\$(DC_EXEC)" + +second_target_prereqs="" +second_target_cmd="$default_target_cmd" +second_target="\$(BC_EXEC)" + +if [ "$library" -ne 0 ]; then + + extra_math=1 + nls=0 + hist=0 + prompt=0 + bc=1 + dc=1 + + default_target_prereqs="\$(BIN) \$(OBJ)" + default_target_cmd="ar -r -cu \$(LIBBC) \$(OBJ)" + default_target="\$(LIBBC)" + tests="test_library" + +elif [ "$bc_only" -eq 1 ]; then bc=1 dc=0 @@ -615,14 +778,16 @@ if [ "$bc_only" -eq 1 ]; then executables="bc" dc_test="@printf 'No dc tests to run\\\\n'" - dc_time_test="@printf 'No dc tests to run\\\\n'" - vg_dc_test="@printf 'No dc tests to run\\\\n'" install_prereqs=" install_execs" install_man_prereqs=" install_bc_manpage" uninstall_prereqs=" uninstall_bc" uninstall_man_prereqs=" uninstall_bc_manpage" + default_target="\$(BC_EXEC)" + second_target="\$(DC_EXEC)" + tests="test_bc timeconst" + elif [ "$dc_only" -eq 1 ]; then bc=0 @@ -637,8 +802,6 @@ elif [ "$dc_only" -eq 1 ]; then executable="DC_EXEC" bc_test="@printf 'No bc tests to run\\\\n'" - bc_time_test="@printf 'No bc tests to run\\\\n'" - vg_bc_test="@printf 'No bc tests to run\\\\n'" timeconst="@printf 'timeconst cannot be run because bc is not built\\\\n'" @@ -647,6 +810,8 @@ elif [ "$dc_only" -eq 1 ]; then uninstall_prereqs=" uninstall_dc" uninstall_man_prereqs=" uninstall_dc_manpage" + tests="test_dc" + else bc=1 @@ -654,8 +819,6 @@ else executables="bc and dc" - link="\$(LINK) \$(BIN) \$(EXEC_PREFIX)\$(DC)" - karatsuba="@\$(KARATSUBA) 30 0 \$(BC_EXEC)" karatsuba_test="@\$(KARATSUBA) 1 100 \$(BC_EXEC)" @@ -672,6 +835,18 @@ else tests="test_library" fi + second_target_prereqs="$default_target_prereqs" + default_target_prereqs="$second_target" + default_target_cmd="\$(LINK) \$(BIN) \$(EXEC_PREFIX)\$(DC)" + +fi + +if [ "$fuzz" -ne 0 ]; then + debug=1 + hist=0 + prompt=0 + nls=0 + optimization="3" fi if [ "$debug" -eq 1 ]; then @@ -763,16 +938,6 @@ else uninstall_man_prereqs="" fi -if [ "$library" -ne 0 ]; then - extra_math=1 - nls=0 - hist=0 - prompt=0 - ALL_PREREQ="library" -else - ALL_PREREQ="execs" -fi - if [ "$nls" -ne 0 ]; then set +e @@ -913,13 +1078,21 @@ else fi manpage_args="" +unneeded="" +headers="\$(HEADERS)" if [ "$extra_math" -eq 0 ]; then manpage_args="E" + unneeded="$unneeded rand.c" +else + headers="$headers \$(EXTRA_MATH_HEADERS)" fi if [ "$hist" -eq 0 ]; then manpage_args="${manpage_args}H" + unneeded="$unneeded history.c" +else + headers="$headers \$(HISTORY_HEADERS)" fi if [ "$nls" -eq 0 ]; then @@ -930,26 +1103,16 @@ if [ "$prompt" -eq 0 ]; then manpage_args="${manpage_args}P" fi -if [ "$manpage_args" = "" ]; then - manpage_args="A" -fi - -unneeded="" - -if [ "$hist" -eq 0 ]; then - unneeded="$unneeded history.c" -fi - if [ "$bc" -eq 0 ]; then unneeded="$unneeded bc.c bc_lex.c bc_parse.c" +else + headers="$headers \$(BC_HEADERS)" fi if [ "$dc" -eq 0 ]; then unneeded="$unneeded dc.c dc_lex.c dc_parse.c" -fi - -if [ "$extra_math" -eq 0 ]; then - unneeded="$unneeded rand.c" +else + headers="$headers \$(DC_HEADERS)" fi if [ "$library" -ne 0 ]; then @@ -957,10 +1120,24 @@ if [ "$library" -ne 0 ]; then unneeded="$unneeded lang.c lex.c parse.c program.c" unneeded="$unneeded bc.c bc_lex.c bc_parse.c" unneeded="$unneeded dc.c dc_lex.c dc_parse.c" + headers="$headers \$(LIBRARY_HEADERS)" else unneeded="$unneeded library.c" fi +if [ "$manpage_args" = "" ]; then + manpage_args="A" +fi + +if [ "$vg" -ne 0 ]; then + memcheck=1 +fi + +bc_tests=$(gen_test_targets bc) +bc_script_tests=$(gen_script_test_targets bc) +dc_tests=$(gen_test_targets dc) +dc_script_tests=$(gen_script_test_targets dc) + # Print out the values; this is for debugging. if [ "$bc" -ne 0 ]; then printf 'Building bc\n' @@ -978,6 +1155,7 @@ printf 'BC_ENABLE_HISTORY=%s\n' "$hist" printf 'BC_ENABLE_EXTRA_MATH=%s\n' "$extra_math" printf 'BC_ENABLE_NLS=%s\n' "$nls" printf 'BC_ENABLE_PROMPT=%s\n' "$prompt" +printf 'BC_ENABLE_AFL=%s\n' "$fuzz" printf '\n' printf 'BC_NUM_KARATSUBA_LEN=%s\n' "$karatsuba_len" printf '\n' @@ -1012,20 +1190,50 @@ replacement='*** WARNING: Autogenerated from Makefile.in. DO NOT MODIFY ***' contents=$(replace "$contents" "$needle" "$replacement") if [ "$unneeded" = "" ]; then - contents=$(gen_file_list "$contents" "library.c") -else - contents=$(gen_file_list "$contents" $unneeded) + unneeded="library.c" fi +contents=$(gen_file_list "$contents" $unneeded) + +SRC_TARGETS="" + +src_files=$(find_src_files $unneeded) + +temp_ifs="$IFS" +IFS=$'\n' + +for f in $src_files; do + o=$(replace_ext "$f" "c" "o") + SRC_TARGETS=$(printf '%s\n\n%s: %s %s\n\t$(CC) $(CFLAGS) -o %s -c %s\n' \ + "$SRC_TARGETS" "$o" "$headers" "$f" "$o" "$f") +done + +IFS="$temp_ifs" + +contents=$(replace "$contents" "HEADERS" "$headers") + contents=$(replace "$contents" "BC_ENABLED" "$bc") contents=$(replace "$contents" "DC_ENABLED" "$dc") -contents=$(replace "$contents" "LINK" "$link") + +contents=$(replace "$contents" "BC_ALL_TESTS" "$bc_test") +contents=$(replace "$contents" "BC_TESTS" "$bc_tests") +contents=$(replace "$contents" "BC_SCRIPT_TESTS" "$bc_script_tests") +contents=$(replace "$contents" "BC_TEST_EXEC" "$bc_test_exec") +contents=$(replace "$contents" "TIMECONST_ALL_TESTS" "$timeconst") + +contents=$(replace "$contents" "DC_ALL_TESTS" "$dc_test") +contents=$(replace "$contents" "DC_TESTS" "$dc_tests") +contents=$(replace "$contents" "DC_SCRIPT_TESTS" "$dc_script_tests") +contents=$(replace "$contents" "DC_TEST_EXEC" "$dc_test_exec") contents=$(replace "$contents" "LIBRARY" "$library") contents=$(replace "$contents" "HISTORY" "$hist") contents=$(replace "$contents" "EXTRA_MATH" "$extra_math") contents=$(replace "$contents" "NLS" "$nls") contents=$(replace "$contents" "PROMPT" "$prompt") +contents=$(replace "$contents" "FUZZ" "$fuzz") +contents=$(replace "$contents" "MEMCHECK" "$memcheck") + contents=$(replace "$contents" "BC_LIB_O" "$bc_lib") contents=$(replace "$contents" "BC_HELP_O" "$bc_help") contents=$(replace "$contents" "DC_HELP_O" "$dc_help") @@ -1057,7 +1265,18 @@ contents=$(replace "$contents" "UNINSTALL_MAN_PREREQS" "$uninstall_man_prereqs") contents=$(replace "$contents" "UNINSTALL_PREREQS" "$uninstall_prereqs") contents=$(replace "$contents" "UNINSTALL_LOCALES_PREREQS" "$uninstall_locales_prereqs") +contents=$(replace "$contents" "DEFAULT_TARGET" "$default_target") +contents=$(replace "$contents" "DEFAULT_TARGET_PREREQS" "$default_target_prereqs") +contents=$(replace "$contents" "DEFAULT_TARGET_CMD" "$default_target_cmd") +contents=$(replace "$contents" "SECOND_TARGET" "$second_target") +contents=$(replace "$contents" "SECOND_TARGET_PREREQS" "$second_target_prereqs") +contents=$(replace "$contents" "SECOND_TARGET_CMD" "$second_target_cmd") + contents=$(replace "$contents" "ALL_PREREQ" "$ALL_PREREQ") +contents=$(replace "$contents" "BC_EXEC_PREREQ" "$bc_exec_prereq") +contents=$(replace "$contents" "BC_EXEC_CMD" "$bc_exec_cmd") +contents=$(replace "$contents" "DC_EXEC_PREREQ" "$dc_exec_prereq") +contents=$(replace "$contents" "DC_EXEC_CMD" "$dc_exec_cmd") contents=$(replace "$contents" "EXECUTABLES" "$executables") contents=$(replace "$contents" "MAIN_EXEC" "$main_exec") @@ -1065,10 +1284,7 @@ contents=$(replace "$contents" "EXEC" "$executable") contents=$(replace "$contents" "TESTS" "$tests") contents=$(replace "$contents" "BC_TEST" "$bc_test") -contents=$(replace "$contents" "BC_TIME_TEST" "$bc_time_test") - contents=$(replace "$contents" "DC_TEST" "$dc_test") -contents=$(replace "$contents" "DC_TIME_TEST" "$dc_time_test") contents=$(replace "$contents" "VG_BC_TEST" "$vg_bc_test") contents=$(replace "$contents" "VG_DC_TEST" "$vg_dc_test") @@ -1086,7 +1302,17 @@ contents=$(replace "$contents" "GEN_EXEC_TARGET" "$GEN_EXEC_TARGET") contents=$(replace "$contents" "CLEAN_PREREQS" "$CLEAN_PREREQS") contents=$(replace "$contents" "GEN_EMU" "$GEN_EMU") -printf '%s\n' "$contents" > "$scriptdir/Makefile" +printf '%s\n%s\n\n' "$contents" "$SRC_TARGETS" > "$scriptdir/Makefile" + +if [ "$bc" -ne 0 ]; then + gen_tests bc BC "$extra_math" "$time_tests" $bc_test_exec + gen_script_tests bc "$extra_math" "$generate_tests" "$time_tests" $bc_test_exec +fi + +if [ "$dc" -ne 0 ]; then + gen_tests dc DC "$extra_math" "$time_tests" $dc_test_exec + gen_script_tests dc "$extra_math" "$generate_tests" "$time_tests" $dc_test_exec +fi cd "$scriptdir" diff --git a/contrib/bc/exec-install.sh b/contrib/bc/exec-install.sh index 6d1600330ba9..5905fd181d97 100755 --- a/contrib/bc/exec-install.sh +++ b/contrib/bc/exec-install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/functions.sh b/contrib/bc/functions.sh index 96afb059c951..87f3c85cb532 100755 --- a/contrib/bc/functions.sh +++ b/contrib/bc/functions.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -59,10 +59,56 @@ err_exit() { fi printf '%s\n' "$1" - printf '\nexiting...\n' exit "$2" } +checktest_retcode() { + + _checktest_retcode_d="$1" + shift + + _checktest_retcode_err="$1" + shift + + _checktest_retcode_name="$1" + shift + + if [ "$_checktest_retcode_err" -ne 0 ]; then + printf 'FAIL!!!\n' + err_exit "$_checktest_retcode_d failed test '$_checktest_retcode_name' with error code $_checktest_retcode_err" 1 + fi +} + +checktest() { + + _checktest_d="$1" + shift + + _checktest_err="$1" + shift + + _checktest_name="$1" + shift + + _checktest_test_path="$1" + shift + + _checktest_results_name="$1" + shift + + checktest_retcode "$_checktest_d" "$_checktest_err" "$_checktest_name" + + _checktest_diff=$(diff "$_checktest_test_path" "$_checktest_results_name") + + _checktest_err="$?" + + if [ "$_checktest_err" -ne 0 ]; then + printf 'FAIL!!!\n' + printf '%s\n' "$_checktest_diff" + err_exit "$_checktest_d failed test $_checktest_name" 1 + fi +} + die() { _die_d="$1" @@ -99,49 +145,49 @@ checkcrash() { fi } -checktest() +checkerrtest() { - _checktest_d="$1" + _checkerrtest_d="$1" shift - _checktest_error="$1" + _checkerrtest_error="$1" shift - _checktest_name="$1" + _checkerrtest_name="$1" shift - _checktest_out="$1" + _checkerrtest_out="$1" shift - _checktest_exebase="$1" + _checkerrtest_exebase="$1" shift - checkcrash "$_checktest_d" "$_checktest_error" "$_checktest_name" + checkcrash "$_checkerrtest_d" "$_checkerrtest_error" "$_checkerrtest_name" - if [ "$_checktest_error" -eq 0 ]; then - die "$_checktest_d" "returned no error" "$_checktest_name" 127 + if [ "$_checkerrtest_error" -eq 0 ]; then + die "$_checkerrtest_d" "returned no error" "$_checkerrtest_name" 127 fi - if [ "$_checktest_error" -eq 100 ]; then + if [ "$_checkerrtest_error" -eq 100 ]; then - _checktest_output=$(cat "$_checktest_out") - _checktest_fatal_error="Fatal error" + _checkerrtest_output=$(cat "$_checkerrtest_out") + _checkerrtest_fatal_error="Fatal error" - if [ "${_checktest_output##*$_checktest_fatal_error*}" ]; then - printf "%s\n" "$_checktest_output" - die "$_checktest_d" "had memory errors on a non-fatal error" \ - "$_checktest_name" "$_checktest_error" + if [ "${_checkerrtest_output##*$_checkerrtest_fatal_error*}" ]; then + printf "%s\n" "$_checkerrtest_output" + die "$_checkerrtest_d" "had memory errors on a non-fatal error" \ + "$_checkerrtest_name" "$_checkerrtest_error" fi fi - if [ ! -s "$_checktest_out" ]; then - die "$_checktest_d" "produced no error message" "$_checktest_name" "$_checktest_error" + if [ ! -s "$_checkerrtest_out" ]; then + die "$_checkerrtest_d" "produced no error message" "$_checkerrtest_name" "$_checkerrtest_error" fi # Display the error messages if not directly running exe. # This allows the script to print valgrind output. - if [ "$_checktest_exebase" != "bc" -a "$_checktest_exebase" != "dc" ]; then - cat "$_checktest_out" + if [ "$_checkerrtest_exebase" != "bc" -a "$_checkerrtest_exebase" != "dc" ]; then + cat "$_checkerrtest_out" fi } diff --git a/contrib/bc/gen/bc_help.txt b/contrib/bc/gen/bc_help.txt index e013251b16bb..3f5aac892268 100644 --- a/contrib/bc/gen/bc_help.txt +++ b/contrib/bc/gen/bc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/gen/dc_help.txt b/contrib/bc/gen/dc_help.txt index 6a26ece26488..4b6a61c872f6 100644 --- a/contrib/bc/gen/dc_help.txt +++ b/contrib/bc/gen/dc_help.txt @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/gen/lib.bc b/contrib/bc/gen/lib.bc index 7768eb74bad1..2cd9256efa53 100644 --- a/contrib/bc/gen/lib.bc +++ b/contrib/bc/gen/lib.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/gen/lib2.bc b/contrib/bc/gen/lib2.bc index 98baffdd30f6..b0e651eddcbd 100644 --- a/contrib/bc/gen/lib2.bc +++ b/contrib/bc/gen/lib2.bc @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/gen/strgen.c b/contrib/bc/gen/strgen.c index 0b2306152874..2d133ba51e68 100644 --- a/contrib/bc/gen/strgen.c +++ b/contrib/bc/gen/strgen.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -43,7 +43,7 @@ #include <libgen.h> static const char* const bc_gen_header = - "// Copyright (c) 2018-2020 Gavin D. Howard and contributors.\n" + "// Copyright (c) 2018-2021 Gavin D. Howard and contributors.\n" "// Licensed under the 2-clause BSD license.\n" "// *** AUTOMATICALLY GENERATED FROM %s. DO NOT MODIFY. ***\n\n"; diff --git a/contrib/bc/gen/strgen.sh b/contrib/bc/gen/strgen.sh index 27edf9a1355d..0af6bdf65b5c 100755 --- a/contrib/bc/gen/strgen.sh +++ b/contrib/bc/gen/strgen.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -64,7 +64,7 @@ if [ -n "$remove_tabs" ]; then fi cat<<EOF -// Copyright (c) 2018-2020 Gavin D. Howard and contributors. +// Copyright (c) 2018-2021 Gavin D. Howard and contributors. // Licensed under the 2-clause BSD license. // *** AUTOMATICALLY GENERATED FROM ${input}. DO NOT MODIFY. *** diff --git a/contrib/bc/include/args.h b/contrib/bc/include/args.h index f2bc2d6bab05..6b68ed300440 100644 --- a/contrib/bc/include/args.h +++ b/contrib/bc/include/args.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/bc.h b/contrib/bc/include/bc.h index 383e7e7ec562..f519d09c4838 100644 --- a/contrib/bc/include/bc.h +++ b/contrib/bc/include/bc.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/bcl.h b/contrib/bc/include/bcl.h index 05f1631e5534..3c67beb23122 100644 --- a/contrib/bc/include/bcl.h +++ b/contrib/bc/include/bcl.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/dc.h b/contrib/bc/include/dc.h index 07af135bc38f..315aeb78b1ad 100644 --- a/contrib/bc/include/dc.h +++ b/contrib/bc/include/dc.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/file.h b/contrib/bc/include/file.h index 6fa08b3f436c..1c3273b7a756 100644 --- a/contrib/bc/include/file.h +++ b/contrib/bc/include/file.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/history.h b/contrib/bc/include/history.h index c632bc81a2a0..d3622ae15a30 100644 --- a/contrib/bc/include/history.h +++ b/contrib/bc/include/history.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/lang.h b/contrib/bc/include/lang.h index a8ab08ad9bf4..7158f10dc0f4 100644 --- a/contrib/bc/include/lang.h +++ b/contrib/bc/include/lang.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/lex.h b/contrib/bc/include/lex.h index ff9592b6e928..2da42d432f1e 100644 --- a/contrib/bc/include/lex.h +++ b/contrib/bc/include/lex.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/library.h b/contrib/bc/include/library.h index 17c3f572caee..3b98091fa523 100644 --- a/contrib/bc/include/library.h +++ b/contrib/bc/include/library.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/num.h b/contrib/bc/include/num.h index 4868ae3de6a8..2104f8b8acad 100644 --- a/contrib/bc/include/num.h +++ b/contrib/bc/include/num.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -236,7 +236,9 @@ void bc_num_zero(BcNum *restrict n); void bc_num_one(BcNum *restrict n); ssize_t bc_num_cmpZero(const BcNum *n); +#if !defined(NDEBUG) || BC_ENABLE_LIBRARY bool bc_num_strValid(const char *restrict val); +#endif // !defined(NDEBUG) || BC_ENABLE_LIBRARY void bc_num_parse(BcNum *restrict n, const char *restrict val, BcBigDig base); void bc_num_print(BcNum *restrict n, BcBigDig base, bool newline); #if DC_ENABLED diff --git a/contrib/bc/include/opt.h b/contrib/bc/include/opt.h index eb3d5959adc0..e828a92c94df 100644 --- a/contrib/bc/include/opt.h +++ b/contrib/bc/include/opt.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/parse.h b/contrib/bc/include/parse.h index 7f59885346dc..36d6e8c60afd 100644 --- a/contrib/bc/include/parse.h +++ b/contrib/bc/include/parse.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/program.h b/contrib/bc/include/program.h index a9805fbfb316..ec31f3486270 100644 --- a/contrib/bc/include/program.h +++ b/contrib/bc/include/program.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/rand.h b/contrib/bc/include/rand.h index a2fb713803ee..77663d9e13d2 100644 --- a/contrib/bc/include/rand.h +++ b/contrib/bc/include/rand.h @@ -1,34 +1,6 @@ /* * ***************************************************************************** * - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * ***************************************************************************** - * * Parts of this code are adapted from the following: * * PCG, A Family of Better Random Number Generators. @@ -38,9 +10,10 @@ * * ----------------------------------------------------------------------------- * - * Parts of this code are also under the following license: + * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal diff --git a/contrib/bc/include/read.h b/contrib/bc/include/read.h index 664ff983e522..84d65063f14a 100644 --- a/contrib/bc/include/read.h +++ b/contrib/bc/include/read.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/include/status.h b/contrib/bc/include/status.h index 2807a28af4ef..3fa844485690 100644 --- a/contrib/bc/include/status.h +++ b/contrib/bc/include/status.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -46,6 +46,16 @@ #define DC_ENABLED (1) #endif // DC_ENABLED +#if BC_ENABLE_AFL +#ifndef __AFL_HAVE_MANUAL_CONTROL +#error Must compile with afl-clang-fast for fuzzing +#endif // __AFL_HAVE_MANUAL_CONTROL +#endif // BC_ENABLE_AFL + +#ifndef BC_ENABLE_MEMCHECK +#define BC_ENABLE_MEMCHECK (0) +#endif // BC_ENABLE_MEMCHECK + #include <bcl.h> typedef enum BcStatus { @@ -173,7 +183,7 @@ typedef enum BcErr { #endif // defined(__has_attribute) && __has_attribute(fallthrough) #else // defined(__clang__) || defined(__GNUC__) #define BC_FALLTHROUGH -#endif //defined(__clang__) || defined(__GNUC__) +#endif // defined(__clang__) || defined(__GNUC__) // Workarounds for AIX's POSIX incompatibility. #ifndef SIZE_MAX diff --git a/contrib/bc/include/vector.h b/contrib/bc/include/vector.h index fdfb85d58228..45398cba2eda 100644 --- a/contrib/bc/include/vector.h +++ b/contrib/bc/include/vector.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -91,6 +91,7 @@ bool bc_map_insert(BcVec *restrict v, const char *name, size_t bc_map_index(const BcVec *restrict v, const char *name); #define bc_vec_pop(v) (bc_vec_npop((v), 1)) +#define bc_vec_popAll(v) (bc_vec_npop((v), (v)->len)) #define bc_vec_top(v) (bc_vec_item_rev((v), 0)) #ifndef NDEBUG diff --git a/contrib/bc/include/vm.h b/contrib/bc/include/vm.h index 72a5150266a1..8b0babff4d81 100644 --- a/contrib/bc/include/vm.h +++ b/contrib/bc/include/vm.h @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -318,7 +318,7 @@ typedef struct BcVm { #if !BC_ENABLE_LIBRARY BcParse prs; BcProgram prog; -#endif // BC_ENABLE_LIBRARY +#endif // !BC_ENABLE_LIBRARY BcVec jmp_bufs; @@ -343,7 +343,7 @@ typedef struct BcVm { const char* file; const char *sigmsg; -#endif // BC_ENABLE_LIBRARY +#endif // !BC_ENABLE_LIBRARY volatile sig_atomic_t sig_lock; volatile sig_atomic_t sig; #if !BC_ENABLE_LIBRARY @@ -357,7 +357,7 @@ typedef struct BcVm { bool no_exit_exprs; bool eof; -#endif // BC_ENABLE_LIBRARY +#endif // !BC_ENABLE_LIBRARY BcBigDig maxes[BC_PROG_GLOBALS_LEN + BC_ENABLE_EXTRA_MATH]; @@ -382,7 +382,7 @@ typedef struct BcVm { const char *err_msgs[BC_ERR_NELEMS]; const char *locale; -#endif // BC_ENABLE_LIBRARY +#endif // !BC_ENABLE_LIBRARY BcBigDig last_base; BcBigDig last_pow; @@ -392,7 +392,7 @@ typedef struct BcVm { #if !BC_ENABLE_LIBRARY char *env_args_buffer; BcVec env_args; -#endif // BC_ENABLE_LIBRARY +#endif // !BC_ENABLE_LIBRARY BcNum max; BcNum max2; @@ -436,8 +436,15 @@ void bc_vm_jmp(void); #if BC_ENABLE_LIBRARY void bc_vm_handleError(BcErr e); +void bc_vm_fatalError(BcErr e); +void bc_vm_atexit(void); #else // BC_ENABLE_LIBRARY void bc_vm_handleError(BcErr e, size_t line, ...); +#if !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK +BC_NORETURN +#endif // !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK +void bc_vm_fatalError(BcErr e); +int bc_vm_atexit(int status); #endif // BC_ENABLE_LIBRARY extern const char bc_copyright[]; diff --git a/contrib/bc/karatsuba.py b/contrib/bc/karatsuba.py index a3cc8e6eed40..f8087301f54c 100755 --- a/contrib/bc/karatsuba.py +++ b/contrib/bc/karatsuba.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/link.sh b/contrib/bc/link.sh index 6f235c0920da..b983fa210876 100755 --- a/contrib/bc/link.sh +++ b/contrib/bc/link.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locale_install.sh b/contrib/bc/locale_install.sh index 38863d2b2969..6c9c292408d9 100755 --- a/contrib/bc/locale_install.sh +++ b/contrib/bc/locale_install.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locale_uninstall.sh b/contrib/bc/locale_uninstall.sh index d38a5470e791..d97fc759809c 100755 --- a/contrib/bc/locale_uninstall.sh +++ b/contrib/bc/locale_uninstall.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/de_DE.ISO8859-1.msg b/contrib/bc/locales/de_DE.ISO8859-1.msg index 518ddf0cf473..57e9673fcef1 100644 --- a/contrib/bc/locales/de_DE.ISO8859-1.msg +++ b/contrib/bc/locales/de_DE.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/de_DE.UTF-8.msg b/contrib/bc/locales/de_DE.UTF-8.msg index 2e3cd675b451..a0b75aa202b9 100644 --- a/contrib/bc/locales/de_DE.UTF-8.msg +++ b/contrib/bc/locales/de_DE.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/en_US.msg b/contrib/bc/locales/en_US.msg index 3d0ca99ac8cc..84288512ead2 100644 --- a/contrib/bc/locales/en_US.msg +++ b/contrib/bc/locales/en_US.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/es_ES.ISO8859-1.msg b/contrib/bc/locales/es_ES.ISO8859-1.msg index 5a66561e9758..ba4e924d17bf 100644 --- a/contrib/bc/locales/es_ES.ISO8859-1.msg +++ b/contrib/bc/locales/es_ES.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/es_ES.UTF-8.msg b/contrib/bc/locales/es_ES.UTF-8.msg index ab33b973f675..46a54bfbc3a7 100644 --- a/contrib/bc/locales/es_ES.UTF-8.msg +++ b/contrib/bc/locales/es_ES.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/fr_FR.ISO8859-1.msg b/contrib/bc/locales/fr_FR.ISO8859-1.msg index 42c3f26ca5b7..f0d435ade43b 100644 --- a/contrib/bc/locales/fr_FR.ISO8859-1.msg +++ b/contrib/bc/locales/fr_FR.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/fr_FR.UTF-8.msg b/contrib/bc/locales/fr_FR.UTF-8.msg index 42c3f26ca5b7..f0d435ade43b 100644 --- a/contrib/bc/locales/fr_FR.UTF-8.msg +++ b/contrib/bc/locales/fr_FR.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ja_JP.UTF-8.msg b/contrib/bc/locales/ja_JP.UTF-8.msg index 587c84413aab..f55f27b4c72b 100644 --- a/contrib/bc/locales/ja_JP.UTF-8.msg +++ b/contrib/bc/locales/ja_JP.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ja_JP.eucJP.msg b/contrib/bc/locales/ja_JP.eucJP.msg index 8229c8f5a665..61430cf3fd4a 100644 --- a/contrib/bc/locales/ja_JP.eucJP.msg +++ b/contrib/bc/locales/ja_JP.eucJP.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/nl_NL.ISO8859-1.msg b/contrib/bc/locales/nl_NL.ISO8859-1.msg index a291baa53963..04e35014f28f 100644 --- a/contrib/bc/locales/nl_NL.ISO8859-1.msg +++ b/contrib/bc/locales/nl_NL.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/nl_NL.UTF-8.msg b/contrib/bc/locales/nl_NL.UTF-8.msg index 07fdbf248815..5b318ecc7fe2 100644 --- a/contrib/bc/locales/nl_NL.UTF-8.msg +++ b/contrib/bc/locales/nl_NL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/pl_PL.ISO8859-2.msg b/contrib/bc/locales/pl_PL.ISO8859-2.msg index b1bbca8054e9..bf993b82baba 100644 --- a/contrib/bc/locales/pl_PL.ISO8859-2.msg +++ b/contrib/bc/locales/pl_PL.ISO8859-2.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/pl_PL.UTF-8.msg b/contrib/bc/locales/pl_PL.UTF-8.msg index 58eee21267d1..c0a08211a709 100644 --- a/contrib/bc/locales/pl_PL.UTF-8.msg +++ b/contrib/bc/locales/pl_PL.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/pt_PT.ISO8859-1.msg b/contrib/bc/locales/pt_PT.ISO8859-1.msg index 055a8f48d47e..f8fb57199049 100644 --- a/contrib/bc/locales/pt_PT.ISO8859-1.msg +++ b/contrib/bc/locales/pt_PT.ISO8859-1.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/pt_PT.UTF-8.msg b/contrib/bc/locales/pt_PT.UTF-8.msg index b07e58228eb3..b41b3fa112b8 100644 --- a/contrib/bc/locales/pt_PT.UTF-8.msg +++ b/contrib/bc/locales/pt_PT.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ru_RU.CP1251.msg b/contrib/bc/locales/ru_RU.CP1251.msg index d54a7bf51fda..b5c005aa972b 100644 --- a/contrib/bc/locales/ru_RU.CP1251.msg +++ b/contrib/bc/locales/ru_RU.CP1251.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ru_RU.CP866.msg b/contrib/bc/locales/ru_RU.CP866.msg index 44325a832dcd..42faa494c66b 100644 --- a/contrib/bc/locales/ru_RU.CP866.msg +++ b/contrib/bc/locales/ru_RU.CP866.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ru_RU.ISO8859-5.msg b/contrib/bc/locales/ru_RU.ISO8859-5.msg index c4f314c5c32b..7065c2f3b689 100644 --- a/contrib/bc/locales/ru_RU.ISO8859-5.msg +++ b/contrib/bc/locales/ru_RU.ISO8859-5.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ru_RU.KOI8-R.msg b/contrib/bc/locales/ru_RU.KOI8-R.msg index 991845680d49..fbd23a68f990 100644 --- a/contrib/bc/locales/ru_RU.KOI8-R.msg +++ b/contrib/bc/locales/ru_RU.KOI8-R.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/ru_RU.UTF-8.msg b/contrib/bc/locales/ru_RU.UTF-8.msg index b0d8165554b2..2f3b6169486a 100644 --- a/contrib/bc/locales/ru_RU.UTF-8.msg +++ b/contrib/bc/locales/ru_RU.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/zh_CN.GB18030.msg b/contrib/bc/locales/zh_CN.GB18030.msg index 36b150b2bcbf..7ee01c7de5c8 100644 --- a/contrib/bc/locales/zh_CN.GB18030.msg +++ b/contrib/bc/locales/zh_CN.GB18030.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/zh_CN.GB2312.msg b/contrib/bc/locales/zh_CN.GB2312.msg index 36b150b2bcbf..7ee01c7de5c8 100644 --- a/contrib/bc/locales/zh_CN.GB2312.msg +++ b/contrib/bc/locales/zh_CN.GB2312.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/zh_CN.GBK.msg b/contrib/bc/locales/zh_CN.GBK.msg index 36b150b2bcbf..7ee01c7de5c8 100644 --- a/contrib/bc/locales/zh_CN.GBK.msg +++ b/contrib/bc/locales/zh_CN.GBK.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/zh_CN.UTF-8.msg b/contrib/bc/locales/zh_CN.UTF-8.msg index 4ca46786fc94..0600dd8c1f86 100644 --- a/contrib/bc/locales/zh_CN.UTF-8.msg +++ b/contrib/bc/locales/zh_CN.UTF-8.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/locales/zh_CN.eucCN.msg b/contrib/bc/locales/zh_CN.eucCN.msg index 36b150b2bcbf..7ee01c7de5c8 100644 --- a/contrib/bc/locales/zh_CN.eucCN.msg +++ b/contrib/bc/locales/zh_CN.eucCN.msg @@ -1,7 +1,7 @@ $ $ $ SPDX-License-Identifier: BSD-2-Clause $ $ -$ Copyright (c) 2018-2020 Gavin D. Howard and contributors. +$ Copyright (c) 2018-2021 Gavin D. Howard and contributors. $ $ $ Redistribution and use in source and binary forms, with or without $ modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manpage.sh b/contrib/bc/manpage.sh index edde671da238..f774bfdb3b20 100755 --- a/contrib/bc/manpage.sh +++ b/contrib/bc/manpage.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc.1.md.in b/contrib/bc/manuals/bc.1.md.in index efc0be037526..624ea3fb54ab 100644 --- a/contrib/bc/manuals/bc.1.md.in +++ b/contrib/bc/manuals/bc.1.md.in @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -459,7 +459,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. {{ end }} ## Numbers diff --git a/contrib/bc/manuals/bc/A.1 b/contrib/bc/manuals/bc/A.1 index 2e2816290587..da35e8c7eaee 100644 --- a/contrib/bc/manuals/bc/A.1 +++ b/contrib/bc/manuals/bc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -519,6 +519,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/A.1.md b/contrib/bc/manuals/bc/A.1.md index 5e5b75bb3821..293a21ad0259 100644 --- a/contrib/bc/manuals/bc/A.1.md +++ b/contrib/bc/manuals/bc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -403,7 +403,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/E.1 b/contrib/bc/manuals/bc/E.1 index 6bacb680af67..02a56e6c653c 100644 --- a/contrib/bc/manuals/bc/E.1 +++ b/contrib/bc/manuals/bc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/E.1.md b/contrib/bc/manuals/bc/E.1.md index 3bec29912b77..7cbc1a56548a 100644 --- a/contrib/bc/manuals/bc/E.1.md +++ b/contrib/bc/manuals/bc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EH.1 b/contrib/bc/manuals/bc/EH.1 index ed19e9769bd7..8cb2a3bc8335 100644 --- a/contrib/bc/manuals/bc/EH.1 +++ b/contrib/bc/manuals/bc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EH.1.md b/contrib/bc/manuals/bc/EH.1.md index 32d95f48fcee..351882878cd3 100644 --- a/contrib/bc/manuals/bc/EH.1.md +++ b/contrib/bc/manuals/bc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EHN.1 b/contrib/bc/manuals/bc/EHN.1 index 39846195d4b3..f751f9d31beb 100644 --- a/contrib/bc/manuals/bc/EHN.1 +++ b/contrib/bc/manuals/bc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EHN.1.md b/contrib/bc/manuals/bc/EHN.1.md index 2eaf8145c90e..dfe1c401970f 100644 --- a/contrib/bc/manuals/bc/EHN.1.md +++ b/contrib/bc/manuals/bc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EHNP.1 b/contrib/bc/manuals/bc/EHNP.1 index 231dc1d404c4..e25cd1a7da42 100644 --- a/contrib/bc/manuals/bc/EHNP.1 +++ b/contrib/bc/manuals/bc/EHNP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EHNP.1.md b/contrib/bc/manuals/bc/EHNP.1.md index 4138ffb98c5e..e55673769736 100644 --- a/contrib/bc/manuals/bc/EHNP.1.md +++ b/contrib/bc/manuals/bc/EHNP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EHP.1 b/contrib/bc/manuals/bc/EHP.1 index 7dcc83b7bddd..7f35d1a1be7f 100644 --- a/contrib/bc/manuals/bc/EHP.1 +++ b/contrib/bc/manuals/bc/EHP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EHP.1.md b/contrib/bc/manuals/bc/EHP.1.md index c012f68fed43..11050003420f 100644 --- a/contrib/bc/manuals/bc/EHP.1.md +++ b/contrib/bc/manuals/bc/EHP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EN.1 b/contrib/bc/manuals/bc/EN.1 index d11c6f7742a1..c8e3a327b2f8 100644 --- a/contrib/bc/manuals/bc/EN.1 +++ b/contrib/bc/manuals/bc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EN.1.md b/contrib/bc/manuals/bc/EN.1.md index e7ba17a98401..950a00c4cd3d 100644 --- a/contrib/bc/manuals/bc/EN.1.md +++ b/contrib/bc/manuals/bc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/ENP.1 b/contrib/bc/manuals/bc/ENP.1 index 0240b22b495a..2116cc69d38d 100644 --- a/contrib/bc/manuals/bc/ENP.1 +++ b/contrib/bc/manuals/bc/ENP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/ENP.1.md b/contrib/bc/manuals/bc/ENP.1.md index 8e5b6fbdd27c..20c380dd1bb2 100644 --- a/contrib/bc/manuals/bc/ENP.1.md +++ b/contrib/bc/manuals/bc/ENP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/EP.1 b/contrib/bc/manuals/bc/EP.1 index 01f34378fd65..2213f7fd3141 100644 --- a/contrib/bc/manuals/bc/EP.1 +++ b/contrib/bc/manuals/bc/EP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator diff --git a/contrib/bc/manuals/bc/EP.1.md b/contrib/bc/manuals/bc/EP.1.md index a853961d683c..d60706d46d91 100644 --- a/contrib/bc/manuals/bc/EP.1.md +++ b/contrib/bc/manuals/bc/EP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/bc/H.1 b/contrib/bc/manuals/bc/H.1 index d6053feab4e8..df3fdf974c82 100644 --- a/contrib/bc/manuals/bc/H.1 +++ b/contrib/bc/manuals/bc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/H.1.md b/contrib/bc/manuals/bc/H.1.md index f764e47cc0f4..476bc32019b2 100644 --- a/contrib/bc/manuals/bc/H.1.md +++ b/contrib/bc/manuals/bc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -399,7 +399,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/HN.1 b/contrib/bc/manuals/bc/HN.1 index 6a8dd876db65..f4b78449838c 100644 --- a/contrib/bc/manuals/bc/HN.1 +++ b/contrib/bc/manuals/bc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/HN.1.md b/contrib/bc/manuals/bc/HN.1.md index 9cc71c3be057..979e0510822f 100644 --- a/contrib/bc/manuals/bc/HN.1.md +++ b/contrib/bc/manuals/bc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -399,7 +399,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/HNP.1 b/contrib/bc/manuals/bc/HNP.1 index 30a8b00a5009..7b1f36a3866b 100644 --- a/contrib/bc/manuals/bc/HNP.1 +++ b/contrib/bc/manuals/bc/HNP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -509,6 +509,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/HNP.1.md b/contrib/bc/manuals/bc/HNP.1.md index 0425073d1c08..608cca1f4c21 100644 --- a/contrib/bc/manuals/bc/HNP.1.md +++ b/contrib/bc/manuals/bc/HNP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -395,7 +395,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/HP.1 b/contrib/bc/manuals/bc/HP.1 index 2ece4e38cbd1..617987fbf743 100644 --- a/contrib/bc/manuals/bc/HP.1 +++ b/contrib/bc/manuals/bc/HP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -509,6 +509,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/HP.1.md b/contrib/bc/manuals/bc/HP.1.md index 482f1a482734..71bc1ff72c09 100644 --- a/contrib/bc/manuals/bc/HP.1.md +++ b/contrib/bc/manuals/bc/HP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -395,7 +395,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/N.1 b/contrib/bc/manuals/bc/N.1 index 9250b028635a..70e8a4945a2b 100644 --- a/contrib/bc/manuals/bc/N.1 +++ b/contrib/bc/manuals/bc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -519,6 +519,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/N.1.md b/contrib/bc/manuals/bc/N.1.md index 63a5acf8ab47..7d7d008fc31c 100644 --- a/contrib/bc/manuals/bc/N.1.md +++ b/contrib/bc/manuals/bc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -403,7 +403,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/NP.1 b/contrib/bc/manuals/bc/NP.1 index 89377821b179..0e45d6dcab62 100644 --- a/contrib/bc/manuals/bc/NP.1 +++ b/contrib/bc/manuals/bc/NP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/NP.1.md b/contrib/bc/manuals/bc/NP.1.md index 60d6a7e59b37..b948badbf5e7 100644 --- a/contrib/bc/manuals/bc/NP.1.md +++ b/contrib/bc/manuals/bc/NP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -399,7 +399,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bc/P.1 b/contrib/bc/manuals/bc/P.1 index 688d6cb612b3..24fd54bcfecc 100644 --- a/contrib/bc/manuals/bc/P.1 +++ b/contrib/bc/manuals/bc/P.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH NAME .PP bc - arbitrary-precision decimal arithmetic language and calculator @@ -514,6 +514,10 @@ generator with \f[B]rand()\f[R] and \f[B]irand(E)\f[R] are guaranteed to This is a consequence of using a seeded pseudo-random number generator. However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .SS Numbers .PP Numbers are strings made up of digits, uppercase letters, and at most diff --git a/contrib/bc/manuals/bc/P.1.md b/contrib/bc/manuals/bc/P.1.md index af712806cfc7..d69e83ab0fc7 100644 --- a/contrib/bc/manuals/bc/P.1.md +++ b/contrib/bc/manuals/bc/P.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -399,7 +399,10 @@ generator. **Note**: The values returned by the pseudo-random number generator with **rand()** and **irand(E)** are guaranteed to *NOT* be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they *are* guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. ## Numbers diff --git a/contrib/bc/manuals/bcl.3 b/contrib/bc/manuals/bcl.3 index cb56f9dd8491..2d265a20511a 100644 --- a/contrib/bc/manuals/bcl.3 +++ b/contrib/bc/manuals/bcl.3 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "BCL" "3" "October 2020" "Gavin D. Howard" "Libraries Manual" +.TH "BCL" "3" "January 2021" "Gavin D. Howard" "Libraries Manual" .SH NAME .PP bcl - library of arbitrary precision decimal arithmetic diff --git a/contrib/bc/manuals/bcl.3.md b/contrib/bc/manuals/bcl.3.md index 93c98923f083..1f515a39b221 100644 --- a/contrib/bc/manuals/bcl.3.md +++ b/contrib/bc/manuals/bcl.3.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc.1.md.in b/contrib/bc/manuals/dc.1.md.in index 5308b1c604a5..72071df06421 100644 --- a/contrib/bc/manuals/dc.1.md.in +++ b/contrib/bc/manuals/dc.1.md.in @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -208,7 +208,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/A.1 b/contrib/bc/manuals/dc/A.1 index c993afb1fd4e..0f1e877cc2e0 100644 --- a/contrib/bc/manuals/dc/A.1 +++ b/contrib/bc/manuals/dc/A.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -233,8 +233,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/A.1.md b/contrib/bc/manuals/dc/A.1.md index d48b2429aaa2..6b278ede8ad0 100644 --- a/contrib/bc/manuals/dc/A.1.md +++ b/contrib/bc/manuals/dc/A.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -197,7 +197,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/E.1 b/contrib/bc/manuals/dc/E.1 index 1e04920d51fd..612187d62353 100644 --- a/contrib/bc/manuals/dc/E.1 +++ b/contrib/bc/manuals/dc/E.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/E.1.md b/contrib/bc/manuals/dc/E.1.md index 3ccf45a98ae3..74011dfd332f 100644 --- a/contrib/bc/manuals/dc/E.1.md +++ b/contrib/bc/manuals/dc/E.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EH.1 b/contrib/bc/manuals/dc/EH.1 index 5ccc64ea725e..04006d873958 100644 --- a/contrib/bc/manuals/dc/EH.1 +++ b/contrib/bc/manuals/dc/EH.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EH.1.md b/contrib/bc/manuals/dc/EH.1.md index b59a5ef71a0c..0fe5bd455ecf 100644 --- a/contrib/bc/manuals/dc/EH.1.md +++ b/contrib/bc/manuals/dc/EH.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EHN.1 b/contrib/bc/manuals/dc/EHN.1 index bce6e577df6c..d6d821627ed5 100644 --- a/contrib/bc/manuals/dc/EHN.1 +++ b/contrib/bc/manuals/dc/EHN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EHN.1.md b/contrib/bc/manuals/dc/EHN.1.md index fd1a0251fd04..a510e6e64de3 100644 --- a/contrib/bc/manuals/dc/EHN.1.md +++ b/contrib/bc/manuals/dc/EHN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EHNP.1 b/contrib/bc/manuals/dc/EHNP.1 index 98cdfd150436..9f331a30e310 100644 --- a/contrib/bc/manuals/dc/EHNP.1 +++ b/contrib/bc/manuals/dc/EHNP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EHNP.1.md b/contrib/bc/manuals/dc/EHNP.1.md index c1d7457770e8..d21343137a5f 100644 --- a/contrib/bc/manuals/dc/EHNP.1.md +++ b/contrib/bc/manuals/dc/EHNP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EHP.1 b/contrib/bc/manuals/dc/EHP.1 index 5f930f841aa4..8a635ed5780f 100644 --- a/contrib/bc/manuals/dc/EHP.1 +++ b/contrib/bc/manuals/dc/EHP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EHP.1.md b/contrib/bc/manuals/dc/EHP.1.md index 2df787cef087..e4ec08ad0ba4 100644 --- a/contrib/bc/manuals/dc/EHP.1.md +++ b/contrib/bc/manuals/dc/EHP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EN.1 b/contrib/bc/manuals/dc/EN.1 index 561a0f665cfc..cc2dd3fcea0e 100644 --- a/contrib/bc/manuals/dc/EN.1 +++ b/contrib/bc/manuals/dc/EN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EN.1.md b/contrib/bc/manuals/dc/EN.1.md index 01c40a8e34dc..0fa12db39760 100644 --- a/contrib/bc/manuals/dc/EN.1.md +++ b/contrib/bc/manuals/dc/EN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/ENP.1 b/contrib/bc/manuals/dc/ENP.1 index 77a94af08310..4bdafbb469a2 100644 --- a/contrib/bc/manuals/dc/ENP.1 +++ b/contrib/bc/manuals/dc/ENP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/ENP.1.md b/contrib/bc/manuals/dc/ENP.1.md index 9eb8696d1755..708ddf4e957e 100644 --- a/contrib/bc/manuals/dc/ENP.1.md +++ b/contrib/bc/manuals/dc/ENP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/EP.1 b/contrib/bc/manuals/dc/EP.1 index 9a41956d67a5..7419872596f8 100644 --- a/contrib/bc/manuals/dc/EP.1 +++ b/contrib/bc/manuals/dc/EP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator diff --git a/contrib/bc/manuals/dc/EP.1.md b/contrib/bc/manuals/dc/EP.1.md index f9333fd29e19..30a55b4074bf 100644 --- a/contrib/bc/manuals/dc/EP.1.md +++ b/contrib/bc/manuals/dc/EP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/dc/H.1 b/contrib/bc/manuals/dc/H.1 index 78f0f55603aa..9eabf89b6f07 100644 --- a/contrib/bc/manuals/dc/H.1 +++ b/contrib/bc/manuals/dc/H.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -233,8 +233,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/H.1.md b/contrib/bc/manuals/dc/H.1.md index 6542f63d4fdc..102ef2e74e6d 100644 --- a/contrib/bc/manuals/dc/H.1.md +++ b/contrib/bc/manuals/dc/H.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -197,7 +197,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/HN.1 b/contrib/bc/manuals/dc/HN.1 index 2c8bde98b88a..a3bf02dcd2b5 100644 --- a/contrib/bc/manuals/dc/HN.1 +++ b/contrib/bc/manuals/dc/HN.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -233,8 +233,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/HN.1.md b/contrib/bc/manuals/dc/HN.1.md index b81a98ffbf4f..fb225f2f9558 100644 --- a/contrib/bc/manuals/dc/HN.1.md +++ b/contrib/bc/manuals/dc/HN.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -197,7 +197,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/HNP.1 b/contrib/bc/manuals/dc/HNP.1 index a777eaa81074..1bb8ea6a2de8 100644 --- a/contrib/bc/manuals/dc/HNP.1 +++ b/contrib/bc/manuals/dc/HNP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -228,8 +228,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/HNP.1.md b/contrib/bc/manuals/dc/HNP.1.md index c4431fd7a4b2..78c37f2a177e 100644 --- a/contrib/bc/manuals/dc/HNP.1.md +++ b/contrib/bc/manuals/dc/HNP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -194,7 +194,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/HP.1 b/contrib/bc/manuals/dc/HP.1 index 872e6ef3e40b..51d477f4a8e7 100644 --- a/contrib/bc/manuals/dc/HP.1 +++ b/contrib/bc/manuals/dc/HP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -228,8 +228,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/HP.1.md b/contrib/bc/manuals/dc/HP.1.md index ffc61e93247b..d9865db53bdf 100644 --- a/contrib/bc/manuals/dc/HP.1.md +++ b/contrib/bc/manuals/dc/HP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -194,7 +194,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/N.1 b/contrib/bc/manuals/dc/N.1 index 590d563faa50..8f4718490813 100644 --- a/contrib/bc/manuals/dc/N.1 +++ b/contrib/bc/manuals/dc/N.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -233,8 +233,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/N.1.md b/contrib/bc/manuals/dc/N.1.md index ef94824c7a00..a79c482c8244 100644 --- a/contrib/bc/manuals/dc/N.1.md +++ b/contrib/bc/manuals/dc/N.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -197,7 +197,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/NP.1 b/contrib/bc/manuals/dc/NP.1 index 01c5f1e854f2..30e6333389c6 100644 --- a/contrib/bc/manuals/dc/NP.1 +++ b/contrib/bc/manuals/dc/NP.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -228,8 +228,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/NP.1.md b/contrib/bc/manuals/dc/NP.1.md index e744a40c2474..74057fb80afc 100644 --- a/contrib/bc/manuals/dc/NP.1.md +++ b/contrib/bc/manuals/dc/NP.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -194,7 +194,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/dc/P.1 b/contrib/bc/manuals/dc/P.1 index a39132aea914..dbbee3e905c0 100644 --- a/contrib/bc/manuals/dc/P.1 +++ b/contrib/bc/manuals/dc/P.1 @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: @@ -25,7 +25,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" .SH Name .PP dc - arbitrary-precision decimal reverse-Polish notation calculator @@ -228,8 +228,12 @@ queried with the \f[B]W\f[R] command. generator with the \f[B]\[cq]\f[R] and \f[B]\[dq]\f[R] commands are guaranteed to \f[B]NOT\f[R] be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. -However, they \f[B]are\f[R] guaranteed to be reproducible with identical +However, they \f[I]are\f[R] guaranteed to be reproducible with identical \f[B]seed\f[R] values. +This means that the pseudo-random values from bc(1) should only be used +where a reproducible stream of pseudo-random numbers is +\f[I]ESSENTIAL\f[R]. +In any other case, use a non-seeded pseudo-random number generator. .PP The pseudo-random number generator, \f[B]seed\f[R], and all associated operations are \f[B]non-portable extensions\f[R]. diff --git a/contrib/bc/manuals/dc/P.1.md b/contrib/bc/manuals/dc/P.1.md index 65771f6c73e1..5d095faaa124 100644 --- a/contrib/bc/manuals/dc/P.1.md +++ b/contrib/bc/manuals/dc/P.1.md @@ -2,7 +2,7 @@ SPDX-License-Identifier: BSD-2-Clause -Copyright (c) 2018-2020 Gavin D. Howard and contributors. +Copyright (c) 2018-2021 Gavin D. Howard and contributors. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -194,7 +194,10 @@ command or the **"** command that does not get receive a value of **0** or **Note**: The values returned by the pseudo-random number generator with the **'** and **"** commands are guaranteed to **NOT** be cryptographically secure. This is a consequence of using a seeded pseudo-random number generator. However, -they **are** guaranteed to be reproducible with identical **seed** values. +they *are* guaranteed to be reproducible with identical **seed** values. This +means that the pseudo-random values from bc(1) should only be used where a +reproducible stream of pseudo-random numbers is *ESSENTIAL*. In any other case, +use a non-seeded pseudo-random number generator. The pseudo-random number generator, **seed**, and all associated operations are **non-portable extensions**. diff --git a/contrib/bc/manuals/header.txt b/contrib/bc/manuals/header.txt index 071157ebd135..d805e14ad691 100644 --- a/contrib/bc/manuals/header.txt +++ b/contrib/bc/manuals/header.txt @@ -1,7 +1,7 @@ .\" .\" SPDX-License-Identifier: BSD-2-Clause .\" -.\" Copyright (c) 2018-2020 Gavin D. Howard and contributors. +.\" Copyright (c) 2018-2021 Gavin D. Howard and contributors. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/manuals/header_bc.txt b/contrib/bc/manuals/header_bc.txt index fa1a54f85693..bf8f772b6e0f 100644 --- a/contrib/bc/manuals/header_bc.txt +++ b/contrib/bc/manuals/header_bc.txt @@ -1 +1 @@ -.TH "BC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "BC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" diff --git a/contrib/bc/manuals/header_bcl.txt b/contrib/bc/manuals/header_bcl.txt index ba9338aadad9..a017f0670a79 100644 --- a/contrib/bc/manuals/header_bcl.txt +++ b/contrib/bc/manuals/header_bcl.txt @@ -1 +1 @@ -.TH "BCL" "3" "October 2020" "Gavin D. Howard" "Libraries Manual" +.TH "BCL" "3" "January 2021" "Gavin D. Howard" "Libraries Manual" diff --git a/contrib/bc/manuals/header_dc.txt b/contrib/bc/manuals/header_dc.txt index b0e8b204f4ee..656210eb0a3a 100644 --- a/contrib/bc/manuals/header_dc.txt +++ b/contrib/bc/manuals/header_dc.txt @@ -1 +1 @@ -.TH "DC" "1" "October 2020" "Gavin D. Howard" "General Commands Manual" +.TH "DC" "1" "January 2021" "Gavin D. Howard" "General Commands Manual" diff --git a/contrib/bc/release.sh b/contrib/bc/release.sh index 2cb39f6b38c5..5f55c0f8acda 100755 --- a/contrib/bc/release.sh +++ b/contrib/bc/release.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -47,7 +47,7 @@ header() { } do_make() { - make -j4 "$@" + make -j16 "$@" } configure() { @@ -326,18 +326,18 @@ vg() { _vg_bits=32 fi - build "$debug" "gcc" "-O0 -g" "1" "$_vg_bits" - runtest valgrind + build "$debug" "gcc" "-O0 -gv" "1" "$_vg_bits" + runtest test do_make clean_config - build "$debug" "gcc" "-O0 -gb" "1" "$_vg_bits" - runtest valgrind + build "$debug" "gcc" "-O0 -gvb" "1" "$_vg_bits" + runtest test do_make clean_config - build "$debug" "gcc" "-O0 -gd" "1" "$_vg_bits" - runtest valgrind + build "$debug" "gcc" "-O0 -gvd" "1" "$_vg_bits" + runtest test do_make clean_config } @@ -514,7 +514,7 @@ else defcc="c99" fi -export ASAN_OPTIONS="abort_on_error=1" +export ASAN_OPTIONS="abort_on_error=1,allocator_may_return_null=1" export UBSAN_OPTIONS="print_stack_trace=1,silence_unsigned_overflow=1" build "$debug" "$defcc" "-g" "1" "$bits" diff --git a/contrib/bc/src/args.c b/contrib/bc/src/args.c index 4c9ad3b95549..b26062c6caec 100644 --- a/contrib/bc/src/args.c +++ b/contrib/bc/src/args.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/bc.c b/contrib/bc/src/bc.c index cdf3cc9c3a28..36b64e17e8de 100644 --- a/contrib/bc/src/bc.c +++ b/contrib/bc/src/bc.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/bc_lex.c b/contrib/bc/src/bc_lex.c index 87475385fe70..159c583e4ae3 100644 --- a/contrib/bc/src/bc_lex.c +++ b/contrib/bc/src/bc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/bc_parse.c b/contrib/bc/src/bc_parse.c index 35d3e45c581c..ea311ab45703 100644 --- a/contrib/bc/src/bc_parse.c +++ b/contrib/bc/src/bc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/data.c b/contrib/bc/src/data.c index a3cf4dbda293..08b8b19b5692 100644 --- a/contrib/bc/src/data.c +++ b/contrib/bc/src/data.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -55,7 +55,7 @@ const uchar dc_sig_msg_len = (uchar) (sizeof(dc_sig_msg) - 1); #endif // DC_ENABLED const char bc_copyright[] = - "Copyright (c) 2018-2020 Gavin D. Howard and contributors\n" + "Copyright (c) 2018-2021 Gavin D. Howard and contributors\n" "Report bugs at: https://git.yzena.com/gavin/bc\n\n" "This is free software with ABSOLUTELY NO WARRANTY.\n"; diff --git a/contrib/bc/src/dc.c b/contrib/bc/src/dc.c index 41c49a08b367..7ea310562217 100644 --- a/contrib/bc/src/dc.c +++ b/contrib/bc/src/dc.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/dc_lex.c b/contrib/bc/src/dc_lex.c index e9a7d2ca1e4b..a0e7454394ec 100644 --- a/contrib/bc/src/dc_lex.c +++ b/contrib/bc/src/dc_lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -61,7 +61,7 @@ static void dc_lex_register(BcLex *l) { bc_lex_name(l); } else { - bc_vec_npop(&l->str, l->str.len); + bc_vec_popAll(&l->str); bc_vec_pushByte(&l->str, (uchar) l->buf[l->i - 1]); bc_vec_pushByte(&l->str, '\0'); l->t = BC_LEX_NAME; @@ -74,7 +74,7 @@ static void dc_lex_string(BcLex *l) { char c; l->t = BC_LEX_STR; - bc_vec_npop(&l->str, l->str.len); + bc_vec_popAll(&l->str); for (; (c = l->buf[i]) && depth; ++i) { diff --git a/contrib/bc/src/dc_parse.c b/contrib/bc/src/dc_parse.c index 81191541fa83..c56d6330544f 100644 --- a/contrib/bc/src/dc_parse.c +++ b/contrib/bc/src/dc_parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/file.c b/contrib/bc/src/file.c index 1d4d390f89a4..e69092f6207a 100644 --- a/contrib/bc/src/file.c +++ b/contrib/bc/src/file.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -105,7 +105,7 @@ void bc_file_flush(BcFile *restrict f) { vm.status = (sig_atomic_t) s; BC_VM_JMP; } - else bc_vm_err(BC_ERR_FATAL_IO_ERR); + else bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); } } diff --git a/contrib/bc/src/history.c b/contrib/bc/src/history.c index ae4b42d326c0..7c4f0ceb0f39 100644 --- a/contrib/bc/src/history.c +++ b/contrib/bc/src/history.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -383,7 +383,7 @@ static BcStatus bc_history_readCode(char *buf, size_t buf_len, return BC_STATUS_SUCCESS; err: - if (BC_ERR(n < 0)) bc_vm_err(BC_ERR_FATAL_IO_ERR); + if (BC_ERR(n < 0)) bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); else *nread = (size_t) n; return BC_STATUS_EOF; } @@ -441,7 +441,7 @@ static void bc_history_enableRaw(BcHistory *h) { BC_SIG_LOCK; if (BC_ERR(tcgetattr(STDIN_FILENO, &h->orig_termios) == -1)) - bc_vm_err(BC_ERR_FATAL_IO_ERR); + bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); BC_SIG_UNLOCK; @@ -473,7 +473,7 @@ static void bc_history_enableRaw(BcHistory *h) { BC_SIG_UNLOCK; - if (BC_ERR(err < 0)) bc_vm_err(BC_ERR_FATAL_IO_ERR); + if (BC_ERR(err < 0)) bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); h->rawMode = true; } @@ -948,7 +948,8 @@ static void bc_history_escape(BcHistory *h) { } else { - if (BC_ERR(BC_HIST_READ(seq + 1, 1))) bc_vm_err(BC_ERR_FATAL_IO_ERR); + if (BC_ERR(BC_HIST_READ(seq + 1, 1))) + bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); // ESC [ sequences. if (c == '[') { @@ -959,13 +960,13 @@ static void bc_history_escape(BcHistory *h) { // Extended escape, read additional byte. if (BC_ERR(BC_HIST_READ(seq + 2, 1))) - bc_vm_err(BC_ERR_FATAL_IO_ERR); + bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); if (seq[2] == '~' && c == '3') bc_history_edit_delete(h); else if(seq[2] == ';') { if (BC_ERR(BC_HIST_READ(seq, 2))) - bc_vm_err(BC_ERR_FATAL_IO_ERR); + bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); if (seq[0] != '5') return; else if (seq[1] == 'C') bc_history_edit_wordEnd(h); diff --git a/contrib/bc/src/lang.c b/contrib/bc/src/lang.c index bc34e7c269f8..46d1968c5914 100644 --- a/contrib/bc/src/lang.c +++ b/contrib/bc/src/lang.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -119,17 +119,17 @@ void bc_func_reset(BcFunc *f) { BC_SIG_ASSERT_LOCKED; assert(f != NULL); - bc_vec_npop(&f->code, f->code.len); + bc_vec_popAll(&f->code); - bc_vec_npop(&f->consts, f->consts.len); + bc_vec_popAll(&f->consts); #if BC_ENABLED if (BC_IS_BC) { - bc_vec_npop(&f->strs, f->strs.len); + bc_vec_popAll(&f->strs); - bc_vec_npop(&f->autos, f->autos.len); - bc_vec_npop(&f->labels, f->labels.len); + bc_vec_popAll(&f->autos); + bc_vec_popAll(&f->labels); f->nparams = 0; f->voidfn = false; @@ -183,7 +183,7 @@ void bc_array_copy(BcVec *d, const BcVec *s) { assert(d != NULL && s != NULL); assert(d != s && d->size == s->size && d->dtor == s->dtor); - bc_vec_npop(d, d->len); + bc_vec_popAll(d); bc_vec_expand(d, s->cap); d->len = s->len; diff --git a/contrib/bc/src/lex.c b/contrib/bc/src/lex.c index d6f09f995a6a..a229f1964d5c 100644 --- a/contrib/bc/src/lex.c +++ b/contrib/bc/src/lex.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -130,7 +130,7 @@ void bc_lex_number(BcLex *l, char start) { l->t = BC_LEX_NUMBER; - bc_vec_npop(&l->str, l->str.len); + bc_vec_popAll(&l->str); bc_vec_push(&l->str, &start); l->i += bc_lex_num(l, start, false); diff --git a/contrib/bc/src/library.c b/contrib/bc/src/library.c index 278b0f55a950..507e58c07d81 100644 --- a/contrib/bc/src/library.c +++ b/contrib/bc/src/library.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -151,9 +151,7 @@ void bcl_free(void) { bc_vec_free(&vm.ctxts); #endif // NDEBUG - bc_vm_shutdown(); - - bc_vec_free(&vm.jmp_bufs); + bc_vm_atexit(); BC_SIG_UNLOCK; @@ -213,8 +211,8 @@ void bcl_ctxt_free(BclContext ctxt) { } void bcl_ctxt_freeNums(BclContext ctxt) { - bc_vec_npop(&ctxt->nums, ctxt->nums.len); - bc_vec_npop(&ctxt->free_nums, ctxt->free_nums.len); + bc_vec_popAll(&ctxt->nums); + bc_vec_popAll(&ctxt->free_nums); } size_t bcl_ctxt_scale(BclContext ctxt) { @@ -891,7 +889,7 @@ char* bcl_string(BclNumber n) { assert(nptr != NULL && nptr->num != NULL); - bc_vec_npop(&vm.out, vm.out.len); + bc_vec_popAll(&vm.out); bc_num_print(nptr, (BcBigDig) ctxt->obase, false); bc_vec_pushByte(&vm.out, '\0'); diff --git a/contrib/bc/src/main.c b/contrib/bc/src/main.c index 9c16e766e798..84a48ff7e301 100644 --- a/contrib/bc/src/main.c +++ b/contrib/bc/src/main.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -49,7 +49,6 @@ int main(int argc, char *argv[]) { - int s; char *name; size_t len = strlen(BC_EXECPREFIX); @@ -78,13 +77,5 @@ int main(int argc, char *argv[]) { exit: BC_SIG_MAYLOCK; - s = !BC_STATUS_IS_ERROR(vm.status) ? BC_STATUS_SUCCESS : (int) vm.status; - - bc_vm_shutdown(); - -#ifndef NDEBUG - bc_vec_free(&vm.jmp_bufs); -#endif // NDEBUG - - return s; + return bc_vm_atexit((int) vm.status); } diff --git a/contrib/bc/src/num.c b/contrib/bc/src/num.c index 0b8823a3fec2..158e06a68875 100644 --- a/contrib/bc/src/num.c +++ b/contrib/bc/src/num.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -1588,9 +1588,9 @@ static void bc_num_parseBase(BcNum *restrict n, const char *restrict val, bc_num_add(&mult1, &temp, n, 0); } - if (i == len && !(c = val[i])) goto int_err; + if (i == len && !val[i]) goto int_err; - assert(c == '.'); + assert(val[i] == '.'); BC_SIG_LOCK; @@ -2665,7 +2665,7 @@ void bc_num_rshift(BcNum *a, BcNum *b, BcNum *c, size_t scale) { void bc_num_sqrt(BcNum *restrict a, BcNum *restrict b, size_t scale) { BcNum num1, num2, half, f, fprime, *x0, *x1, *temp; - size_t pow, len, rdx, req, digs, digs1, digs2, resscale; + size_t pow, len, rdx, req, resscale; BcDig half_digs[1]; assert(a != NULL && b != NULL && a != b); @@ -2736,7 +2736,7 @@ void bc_num_sqrt(BcNum *restrict a, BcNum *restrict b, size_t scale) { } // I can set the rdx here directly because neg should be false. - x0->scale = x0->rdx = digs = digs1 = digs2 = 0; + x0->scale = x0->rdx = 0; resscale = (scale + BC_BASE_DIGS) + 2; while (bc_num_cmp(x1, x0)) { diff --git a/contrib/bc/src/opt.c b/contrib/bc/src/opt.c index 57cee759af5e..3f09afe3b57b 100644 --- a/contrib/bc/src/opt.c +++ b/contrib/bc/src/opt.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/src/parse.c b/contrib/bc/src/parse.c index 39b79efdd02f..2aeb4923135f 100644 --- a/contrib/bc/src/parse.c +++ b/contrib/bc/src/parse.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -159,9 +159,9 @@ void bc_parse_reset(BcParse *p) { #if BC_ENABLED if (BC_IS_BC) { bc_vec_npop(&p->flags, p->flags.len - 1); - bc_vec_npop(&p->exits, p->exits.len); - bc_vec_npop(&p->conds, p->conds.len); - bc_vec_npop(&p->ops, p->ops.len); + bc_vec_popAll(&p->exits); + bc_vec_popAll(&p->conds); + bc_vec_popAll(&p->ops); } #endif // BC_ENABLED diff --git a/contrib/bc/src/program.c b/contrib/bc/src/program.c index f0a67ee194c1..d4e386d4ac1b 100644 --- a/contrib/bc/src/program.c +++ b/contrib/bc/src/program.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -454,7 +454,7 @@ static void bc_program_read(BcProgram *p) { BC_SIG_UNLOCK; bc_lex_file(&parse.l, bc_program_stdin_name); - bc_vec_npop(&f->code, f->code.len); + bc_vec_popAll(&f->code); s = bc_read_line(&buf, BC_IS_BC ? "read> " : "?> "); if (s == BC_STATUS_EOF) bc_vm_err(BC_ERR_EXEC_READ_EXPR); @@ -723,13 +723,13 @@ static void bc_program_logical(BcProgram *p, uchar inst) { } #if DC_ENABLED -static void bc_program_assignStr(BcProgram *p, BcResult *r, +static void bc_program_assignStr(BcProgram *p, size_t idx, BcVec *v, bool push) { BcNum n2; bc_num_clear(&n2); - n2.scale = r->d.loc.loc; + n2.scale = idx; assert(BC_PROG_STACK(&p->results, 1 + !push)); @@ -777,8 +777,13 @@ static void bc_program_copyToVar(BcProgram *p, size_t idx, #if DC_ENABLED if (BC_IS_DC && (ptr->t == BC_RESULT_STR || BC_PROG_STR(n))) { + + size_t str_idx = ptr->t == BC_RESULT_STR ? ptr->d.loc.loc : n->scale; + if (BC_ERR(!var)) bc_vm_err(BC_ERR_EXEC_TYPE); - bc_program_assignStr(p, ptr, vec, true); + + bc_program_assignStr(p, str_idx, vec, true); + return; } #endif // DC_ENABLED @@ -864,7 +869,7 @@ static void bc_program_assign(BcProgram *p, uchar inst) { } else { BcVec *v = bc_program_vec(p, left->d.loc.loc, BC_TYPE_VAR); - bc_program_assignStr(p, right, v, false); + bc_program_assignStr(p, idx, v, false); } return; @@ -1249,8 +1254,10 @@ static void bc_program_builtin(BcProgram *p, uchar inst) { { #if DC_ENABLED if (!BC_PROG_NUM(opd, num)) { + size_t idx; char *str; + idx = opd->t == BC_RESULT_STR ? opd->d.loc.loc : num->scale; str = *((char**) bc_vec_item(p->strs, idx)); val = (BcBigDig) strlen(str); @@ -1578,7 +1585,7 @@ err: BC_SIG_MAYLOCK; bc_parse_free(&prs); f = bc_vec_item(&p->fns, fidx); - bc_vec_npop(&f->code, f->code.len); + bc_vec_popAll(&f->code); exit: bc_vec_pop(&p->results); BC_LONGJMP_CONT; @@ -1714,7 +1721,6 @@ void bc_program_init(BcProgram *p) { BcInstPtr ip; size_t i; - BcBigDig val = BC_BASE; BC_SIG_ASSERT_LOCKED; @@ -1724,8 +1730,8 @@ void bc_program_init(BcProgram *p) { memset(&ip, 0, sizeof(BcInstPtr)); for (i = 0; i < BC_PROG_GLOBALS_LEN; ++i) { + BcBigDig val = i == BC_PROG_GLOBALS_SCALE ? 0 : BC_BASE; bc_vec_init(p->globals_v + i, sizeof(BcBigDig), NULL); - val = i == BC_PROG_GLOBALS_SCALE ? 0 : val; bc_vec_push(p->globals_v + i, &val); p->globals[i] = val; } @@ -1788,16 +1794,17 @@ void bc_program_reset(BcProgram *p) { BC_SIG_ASSERT_LOCKED; bc_vec_npop(&p->stack, p->stack.len - 1); - bc_vec_npop(&p->results, p->results.len); + bc_vec_popAll(&p->results); #if BC_ENABLED if (BC_G) bc_program_popGlobals(p, true); #endif // BC_ENABLED f = bc_vec_item(&p->fns, BC_PROG_MAIN); + bc_vec_npop(&f->code, f->code.len); ip = bc_vec_top(&p->stack); bc_program_setVecs(p, f); - ip->idx = f->code.len; + memset(ip, 0, sizeof(BcInstPtr)); if (vm.sig) { bc_file_write(&vm.fout, bc_program_ready_msg, bc_program_ready_msg_len); @@ -2145,7 +2152,7 @@ void bc_program_exec(BcProgram *p) { case BC_INST_CLEAR_STACK: { - bc_vec_npop(&p->results, p->results.len); + bc_vec_popAll(&p->results); break; } diff --git a/contrib/bc/src/rand.c b/contrib/bc/src/rand.c index a66728246fbc..6b2ec7bdb30f 100644 --- a/contrib/bc/src/rand.c +++ b/contrib/bc/src/rand.c @@ -1,34 +1,6 @@ /* * ***************************************************************************** * - * SPDX-License-Identifier: BSD-2-Clause - * - * Copyright (c) 2018-2019 Gavin D. Howard and contributors. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * * Redistributions of source code must retain the above copyright notice, this - * list of conditions and the following disclaimer. - * - * * Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE - * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - * - * ***************************************************************************** - * * Parts of this code are adapted from the following: * * PCG, A Family of Better Random Number Generators. @@ -38,9 +10,10 @@ * * ----------------------------------------------------------------------------- * - * Parts of this code are also under the following license: + * This code is under the following license: * * Copyright (c) 2014-2017 Melissa O'Neill and PCG Project contributors + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal @@ -179,7 +152,7 @@ static ulong bc_rand_frand(void *ptr) { nread = read(fd, buf, sizeof(ulong)); - if (BC_ERR(nread != sizeof(ulong))) bc_vm_err(BC_ERR_FATAL_IO_ERR); + if (BC_ERR(nread != sizeof(ulong))) bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); return *((ulong*) buf); } @@ -289,6 +262,15 @@ void bc_rand_srand(BcRNGData *rng) { bc_rand_fill(rng, bc_rand_frand, &fd); close(fd); } + else { + + fd = open("/dev/random", O_RDONLY); + + if (BC_NO_ERR(fd >= 0)) { + bc_rand_fill(rng, bc_rand_frand, &fd); + close(fd); + } + } while (BC_ERR(BC_RAND_ZERO(rng))) bc_rand_fill(rng, bc_rand_rand, NULL); diff --git a/contrib/bc/src/read.c b/contrib/bc/src/read.c index 45e868c927da..e593b3c2dedd 100644 --- a/contrib/bc/src/read.c +++ b/contrib/bc/src/read.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -96,7 +96,7 @@ BcStatus bc_read_chars(BcVec *vec, const char *prompt) { BC_SIG_ASSERT_NOT_LOCKED; - bc_vec_npop(vec, vec->len); + bc_vec_popAll(vec); #if BC_ENABLE_PROMPT if (BC_USE_PROMPT) { @@ -143,7 +143,7 @@ BcStatus bc_read_chars(BcVec *vec, const char *prompt) { BC_SIG_UNLOCK; - bc_vm_err(BC_ERR_FATAL_IO_ERR); + bc_vm_fatalError(BC_ERR_FATAL_IO_ERR); } BC_SIG_UNLOCK; diff --git a/contrib/bc/src/vector.c b/contrib/bc/src/vector.c index df6936aaeb76..78dddb1d30fd 100644 --- a/contrib/bc/src/vector.c +++ b/contrib/bc/src/vector.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -203,7 +203,7 @@ void bc_vec_string(BcVec *restrict v, size_t len, const char *restrict str) { BC_SIG_TRYLOCK(lock); - bc_vec_npop(v, v->len); + bc_vec_popAll(v); bc_vec_expand(v, bc_vm_growSize(len, 1)); memcpy(v->v, str, len); v->len = len; @@ -240,7 +240,7 @@ void bc_vec_empty(BcVec *restrict v) { BC_SIG_TRYLOCK(lock); - bc_vec_npop(v, v->len); + bc_vec_popAll(v); bc_vec_pushByte(v, '\0'); BC_SIG_TRYUNLOCK(lock); @@ -283,7 +283,7 @@ inline void bc_vec_clear(BcVec *restrict v) { void bc_vec_free(void *vec) { BcVec *v = (BcVec*) vec; BC_SIG_ASSERT_LOCKED; - bc_vec_npop(v, v->len); + bc_vec_popAll(v); free(v->v); } diff --git a/contrib/bc/src/vm.c b/contrib/bc/src/vm.c index 3922b088414f..d363458bed58 100644 --- a/contrib/bc/src/vm.c +++ b/contrib/bc/src/vm.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -138,6 +138,16 @@ void bc_vm_info(const char* const help) { } #endif // !BC_ENABLE_LIBRARY +#if !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK +BC_NORETURN +#endif // !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK +void bc_vm_fatalError(BcErr e) { + bc_vm_err(e); +#if !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK + abort(); +#endif // !BC_ENABLE_LIBRARY && !BC_ENABLE_MEMCHECK +} + #if BC_ENABLE_LIBRARY void bc_vm_handleError(BcErr e) { @@ -229,8 +239,19 @@ void bc_vm_handleError(BcErr e, size_t line, ...) { s = bc_file_flushErr(&vm.ferr); - vm.status = s == BC_STATUS_ERROR_FATAL ? - (sig_atomic_t) s : (sig_atomic_t) (uchar) (id + 1); +#if !BC_ENABLE_MEMCHECK + // Because this function is called by a BC_NORETURN function when fatal + // errors happen, we need to make sure to exit on fatal errors. This will + // be faster anyway. This function *cannot jump when a fatal error occurs!* + if (BC_ERR(id == BC_ERR_IDX_FATAL || s == BC_STATUS_ERROR_FATAL)) + exit(bc_vm_atexit((int) BC_STATUS_ERROR_FATAL)); +#else // !BC_ENABLE_MEMCHECK + if (BC_ERR(s == BC_STATUS_ERROR_FATAL)) vm.status = (sig_atomic_t) s; + else +#endif // !BC_ENABLE_MEMCHECK + { + vm.status = (sig_atomic_t) (uchar) (id + 1); + } if (BC_ERR(vm.status)) BC_VM_JMP; @@ -367,14 +388,14 @@ void bc_vm_freeTemps(void) { inline size_t bc_vm_arraySize(size_t n, size_t size) { size_t res = n * size; if (BC_ERR(res >= SIZE_MAX || (n != 0 && res / n != size))) - bc_vm_err(BC_ERR_FATAL_ALLOC_ERR); + bc_vm_fatalError(BC_ERR_FATAL_ALLOC_ERR); return res; } inline size_t bc_vm_growSize(size_t a, size_t b) { size_t res = a + b; if (BC_ERR(res >= SIZE_MAX || res < a || res < b)) - bc_vm_err(BC_ERR_FATAL_ALLOC_ERR); + bc_vm_fatalError(BC_ERR_FATAL_ALLOC_ERR); return res; } @@ -386,7 +407,7 @@ void* bc_vm_malloc(size_t n) { ptr = malloc(n); - if (BC_ERR(ptr == NULL)) bc_vm_err(BC_ERR_FATAL_ALLOC_ERR); + if (BC_ERR(ptr == NULL)) bc_vm_fatalError(BC_ERR_FATAL_ALLOC_ERR); return ptr; } @@ -399,7 +420,7 @@ void* bc_vm_realloc(void *ptr, size_t n) { temp = realloc(ptr, n); - if (BC_ERR(temp == NULL)) bc_vm_err(BC_ERR_FATAL_ALLOC_ERR); + if (BC_ERR(temp == NULL)) bc_vm_fatalError(BC_ERR_FATAL_ALLOC_ERR); return temp; } @@ -412,7 +433,7 @@ char* bc_vm_strdup(const char *str) { s = strdup(str); - if (BC_ERR(!s)) bc_vm_err(BC_ERR_FATAL_ALLOC_ERR); + if (BC_ERR(s == NULL)) bc_vm_fatalError(BC_ERR_FATAL_ALLOC_ERR); return s; } @@ -477,18 +498,18 @@ static void bc_vm_clean(void) { #if BC_ENABLED if (BC_IS_BC) { - bc_vec_npop(&f->labels, f->labels.len); - bc_vec_npop(&f->strs, f->strs.len); - bc_vec_npop(&f->consts, f->consts.len); + bc_vec_popAll(&f->labels); + bc_vec_popAll(&f->strs); + bc_vec_popAll(&f->consts); } #endif // BC_ENABLED #if DC_ENABLED // Note to self: you cannot delete strings and functions. Deal with it. - if (BC_IS_DC) bc_vec_npop(vm.prog.consts, vm.prog.consts->len); + if (BC_IS_DC) bc_vec_popAll(vm.prog.consts); #endif // DC_ENABLED - bc_vec_npop(&f->code, f->code.len); + bc_vec_popAll(&f->code); ip->idx = 0; } @@ -659,9 +680,16 @@ err: bc_vm_clean(); +#if !BC_ENABLE_MEMCHECK + assert(vm.status != BC_STATUS_ERROR_FATAL); + + vm.status = vm.status == BC_STATUS_QUIT || !BC_I ? + vm.status : BC_STATUS_SUCCESS; +#else // !BC_ENABLE_MEMCHECK vm.status = vm.status == BC_STATUS_ERROR_FATAL || vm.status == BC_STATUS_QUIT || !BC_I ? vm.status : BC_STATUS_SUCCESS; +#endif // !BC_ENABLE_MEMCHECK if (!vm.status && !vm.eof) { bc_vec_empty(&buffer); @@ -779,7 +807,7 @@ static void bc_vm_exec(void) { bc_vec_pushByte(&buf, '\0'); bc_vm_process(buf.v); - bc_vec_npop(&buf, buf.len); + bc_vec_popAll(&buf); } while (more); @@ -802,10 +830,14 @@ static void bc_vm_exec(void) { bc_vm_file(path); } +#if BC_ENABLE_AFL + __AFL_INIT(); +#endif // BC_ENABLE_AFL + if (BC_IS_BC || !has_file) bc_vm_stdin(); // These are all protected by ifndef NDEBUG because if these are needed, bc is -// goingi to exit anyway, and I see no reason to include this code in a release +// going to exit anyway, and I see no reason to include this code in a release // build when the OS is going to free all of the resources anyway. #ifndef NDEBUG return; @@ -917,3 +949,27 @@ void bc_vm_init(void) { } #endif // BC_ENABLED } + +#if BC_ENABLE_LIBRARY +void bc_vm_atexit(void) { + + bc_vm_shutdown(); + +#ifndef NDEBUG + bc_vec_free(&vm.jmp_bufs); +#endif // NDEBUG +} +#else // BC_ENABLE_LIBRARY +int bc_vm_atexit(int status) { + + int s = BC_STATUS_IS_ERROR(status) ? status : BC_STATUS_SUCCESS; + + bc_vm_shutdown(); + +#ifndef NDEBUG + bc_vec_free(&vm.jmp_bufs); +#endif // NDEBUG + + return s; +} +#endif // BC_ENABLE_LIBRARY diff --git a/contrib/bc/tests/afl.py b/contrib/bc/tests/afl.py index ff3b9229c1c2..a235ee5be176 100755 --- a/contrib/bc/tests/afl.py +++ b/contrib/bc/tests/afl.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -89,6 +89,10 @@ def get_children(dir, get_files): dirs.sort() return dirs + +def exe_name(d): + return "bc" if d == "bc1" or d == "bc2" or d == "bc3" else "dc" + script = sys.argv[0] testdir = os.path.dirname(script) @@ -112,18 +116,26 @@ if asan: usage() exedir = sys.argv[idx] +print("exedir: {}".format(exedir)) + if len(sys.argv) >= idx + 2: resultsdir = sys.argv[idx + 1] else: - if exedir == "bc": - resultsdir = testdir + "/../../results" + if exedir == "bc1": + resultsdir = testdir + "/fuzzing/bc_outputs1" + elif exedir == "bc2": + resultsdir = testdir + "/fuzzing/bc_outputs2" + elif exedir == "bc3": + resultsdir = testdir + "/fuzzing/bc_outputs3" else: - resultsdir = testdir + "/../../results_dc" + resultsdir = testdir + "/fuzzing/dc_outputs" + +print("resultsdir: {}".format(resultsdir)) if len(sys.argv) >= idx + 3: exe = sys.argv[idx + 2] else: - exe = testdir + "/../bin/" + exedir + exe = testdir + "/../bin/" + exe_name(exedir) exebase = os.path.basename(exe) diff --git a/contrib/bc/tests/all.sh b/contrib/bc/tests/all.sh index 07fd346f04c5..1f745cdff079 100755 --- a/contrib/bc/tests/all.sh +++ b/contrib/bc/tests/all.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -110,195 +110,12 @@ done < "$testdir/$d/all.txt" sh "$testdir/stdin.sh" "$d" "$exe" "$@" -sh "$testdir/scripts.sh" "$d" "$extra" "$run_stack_tests" "$generate_tests" "$time_tests" "$exe" "$@" +sh "$testdir/scripts.sh" "$d" "$extra" "$run_stack_tests" "$generate_tests" \ + "$time_tests" "$exe" "$@" sh "$testdir/read.sh" "$d" "$exe" "$@" sh "$testdir/errors.sh" "$d" "$exe" "$@" -num=100000000000000000000000000000000000000000000000000000000000000000000000000000 -numres="$num" -num70="10000000000000000000000000000000000000000000000000000000000000000000\\ -0000000000" - -if [ "$d" = "bc" ]; then - halt="halt" - opt="x" - lopt="extended-register" - line_var="BC_LINE_LENGTH" -else - halt="q" - opt="l" - lopt="mathlib" - line_var="DC_LINE_LENGTH" - num="$num pR" -fi - -printf '\nRunning %s quit test...' "$d" - -printf '%s\n' "$halt" | "$exe" "$@" > /dev/null 2>&1 - -if [ "$d" = bc ]; then - printf '%s\n' "quit" | "$exe" "$@" > /dev/null 2>&1 - two=$("$exe" "$@" -e 1+1 -e quit) - if [ "$two" != "2" ]; then - err_exit "$d failed a quit test" 1 - fi -fi - -printf 'pass\n' - -base=$(basename "$exe") - -if [ "$base" != "bc" -a "$base" != "dc" ]; then - exit 0 -fi - -printf 'Running %s environment var tests...' "$d" - -if [ "$d" = "bc" ]; then - export BC_ENV_ARGS=" '-l' '' -q" - export BC_EXPR_EXIT="1" - printf 's(.02893)\n' | "$exe" "$@" > /dev/null - "$exe" -e 4 "$@" > /dev/null -else - export DC_ENV_ARGS="'-x'" - export DC_EXPR_EXIT="1" - printf '4s stuff\n' | "$exe" "$@" > /dev/null - "$exe" -e 4pR "$@" > /dev/null -fi - -printf 'pass\n' - -out1="$testdir/../.log_$d.txt" -out2="$testdir/../.log_${d}_test.txt" - -printf 'Running %s line length tests...' "$d" - -printf '%s\n' "$numres" > "$out1" - -export "$line_var"=80 -printf '%s\n' "$num" | "$exe" "$@" > "$out2" - -diff "$out1" "$out2" - -printf '%s\n' "$num70" > "$out1" - -export "$line_var"=2147483647 -printf '%s\n' "$num" | "$exe" "$@" > "$out2" - -diff "$out1" "$out2" - -printf 'pass\n' - -printf 'Running %s arg tests...' "$d" - -f="$testdir/$d/add.txt" -exprs=$(cat "$f") -results=$(cat "$testdir/$d/add_results.txt") - -printf '%s\n%s\n%s\n%s\n' "$results" "$results" "$results" "$results" > "$out1" - -"$exe" "$@" -e "$exprs" -f "$f" --expression "$exprs" --file "$f" -e "$halt" > "$out2" - -diff "$out1" "$out2" - -printf '%s\n' "$halt" | "$exe" "$@" -- "$f" "$f" "$f" "$f" > "$out2" - -diff "$out1" "$out2" - -if [ "$d" = "bc" ]; then - printf '%s\n' "$halt" | "$exe" "$@" -i > /dev/null 2>&1 -fi - -printf '%s\n' "$halt" | "$exe" "$@" -h > /dev/null -printf '%s\n' "$halt" | "$exe" "$@" -P > /dev/null -printf '%s\n' "$halt" | "$exe" "$@" -v > /dev/null -printf '%s\n' "$halt" | "$exe" "$@" -V > /dev/null - -set +e - -"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "invalid file argument" "$out2" "$d" - -"$exe" "$@" "-$opt" -e "$exprs" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "invalid option argument" "$out2" "$d" - -"$exe" "$@" "--$lopt" -e "$exprs" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "invalid long option argument" "$out2" "$d" - -"$exe" "$@" "-u" -e "$exprs" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "unrecognized option argument" "$out2" "$d" - -"$exe" "$@" "--uniform" -e "$exprs" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "unrecognized long option argument" "$out2" "$d" - -"$exe" "$@" -f > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "missing required argument to short option" "$out2" "$d" - -"$exe" "$@" --file > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "missing required argument to long option" "$out2" "$d" - -"$exe" "$@" --version=5 > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "given argument to long option with no argument" "$out2" "$d" - -printf 'pass\n' - -printf 'Running %s directory test...' "$d" - -"$exe" "$@" "$testdir" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "directory" "$out2" "$d" - -printf 'pass\n' - -printf 'Running %s binary file test...' "$d" - -bin="/bin/sh" - -"$exe" "$@" "$bin" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "binary file" "$out2" "$d" - -printf 'pass\n' - -printf 'Running %s binary stdin test...' "$d" - -cat "$bin" | "$exe" "$@" > /dev/null 2> "$out2" -err="$?" - -checktest "$d" "$err" "binary stdin" "$out2" "$d" - -printf 'pass\n' - -if [ "$d" = "bc" ]; then - - printf 'Running %s limits tests...' "$d" - printf 'limits\n' | "$exe" "$@" > "$out2" /dev/null 2>&1 - - if [ ! -s "$out2" ]; then - err_exit "$d did not produce output on the limits test" 1 - fi - - printf 'pass\n' - -fi +sh "$testdir/other.sh" "$d" "$exe" "$@" printf '\nAll %s tests passed.\n' "$d" diff --git a/contrib/bc/tests/bc/all.txt b/contrib/bc/tests/bc/all.txt index b623e8a11b71..92cfee226758 100644 --- a/contrib/bc/tests/bc/all.txt +++ b/contrib/bc/tests/bc/all.txt @@ -1,4 +1,7 @@ decimal +print +print2 +parse length scale shift @@ -22,9 +25,6 @@ engineering globals strings letters -print -print2 -parse exponent log pi diff --git a/contrib/bc/tests/bc/scripts/all.txt b/contrib/bc/tests/bc/scripts/all.txt new file mode 100644 index 000000000000..16f067c13b79 --- /dev/null +++ b/contrib/bc/tests/bc/scripts/all.txt @@ -0,0 +1,15 @@ +print.bc +parse.bc +add.bc +subtract.bc +multiply.bc +divide.bc +array.bc +atan.bc +bessel.bc +functions.bc +globals.bc +len.bc +rand.bc +references.bc +screen.bc diff --git a/contrib/bc/tests/bc/timeconst.sh b/contrib/bc/tests/bc/timeconst.sh index 32e1e743d9e4..8cdc63a90e6b 100755 --- a/contrib/bc/tests/bc/timeconst.sh +++ b/contrib/bc/tests/bc/timeconst.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -57,6 +57,11 @@ if [ ! -f "$timeconst" ]; then exit 0 fi +unset BC_ENV_ARGS +unset BC_LINE_LENGTH +unset DC_ENV_ARGS +unset DC_LINE_LENGTH + printf 'Running %s...' "$base" nums=$(printf 'for (i = 0; i <= 1000; ++i) { i }\n' | bc) @@ -88,4 +93,4 @@ done rm -f "$out1" rm -f "$out2" -printf 'pass\n' +exec printf 'pass\n' diff --git a/contrib/bc/tests/bcl.c b/contrib/bc/tests/bcl.c index aab2c5d35e9b..5157890e9bb8 100644 --- a/contrib/bc/tests/bcl.c +++ b/contrib/bc/tests/bcl.c @@ -3,7 +3,7 @@ * * SPDX-License-Identifier: BSD-2-Clause * - * Copyright (c) 2018-2020 Gavin D. Howard and contributors. + * Copyright (c) 2018-2021 Gavin D. Howard and contributors. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/tests/dc/errors/30.txt b/contrib/bc/tests/dc/errors/30.txt new file mode 100644 index 000000000000..e072e71617d8 --- /dev/null +++ b/contrib/bc/tests/dc/errors/30.txt @@ -0,0 +1 @@ +0;0[]0:b;bs0l0x;0 diff --git a/contrib/bc/tests/dc/errors/31.txt b/contrib/bc/tests/dc/errors/31.txt new file mode 100644 index 000000000000..9bada9d07d0e --- /dev/null +++ b/contrib/bc/tests/dc/errors/31.txt @@ -0,0 +1 @@ +0;0[]0:b;bS0l0x;0 diff --git a/contrib/bc/tests/dc/scripts/all.txt b/contrib/bc/tests/dc/scripts/all.txt new file mode 100644 index 000000000000..e15dae5e15ff --- /dev/null +++ b/contrib/bc/tests/dc/scripts/all.txt @@ -0,0 +1,9 @@ +prime.dc +asciify.dc +stream.dc +array.dc +else.dc +factorial.dc +loop.dc +quit.dc +weird.dc diff --git a/contrib/bc/tests/diff.sh b/contrib/bc/tests/diff.sh new file mode 100755 index 000000000000..6d664a8a81b8 --- /dev/null +++ b/contrib/bc/tests/diff.sh @@ -0,0 +1,51 @@ +#! /bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +set -e + +script="$0" + +testdir=$(dirname "$script") + +if [ "$#" -lt 2 ]; then + printf 'usage: %s dir test\n' "$0" + printf 'valid dirs are:\n' + printf '\n' + cat "$testdir/all.txt" + printf '\n' + exit 1 +fi + +d="$1" +shift + +t="$1" +shift + +exec diff "$testdir/$d/${t}_results.txt" "$testdir/${d}_outputs/${t}_results.txt" diff --git a/contrib/bc/tests/errors.sh b/contrib/bc/tests/errors.sh index 17c84ca24ef3..4654aed2f970 100755 --- a/contrib/bc/tests/errors.sh +++ b/contrib/bc/tests/errors.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -49,7 +49,17 @@ else shift fi -out="$testdir/../.log_${d}_test.txt" +unset BC_ENV_ARGS +unset BC_LINE_LENGTH +unset DC_ENV_ARGS +unset DC_LINE_LENGTH + +out="$testdir/${d}_outputs/errors_results.txt" +outdir=$(dirname "$out") + +if [ ! -d "$outdir" ]; then + mkdir -p "$outdir" +fi exebase=$(basename "$exe") @@ -83,7 +93,7 @@ for testfile in $testdir/$d/*errors.txt; do die "$d" "returned an error ($err)" "POSIX warning" 1 fi - checktest "$d" "1" "$line" "$out" "$exebase" + checkerrtest "$d" "1" "$line" "$out" "$exebase" options="-ls" else @@ -101,7 +111,7 @@ for testfile in $testdir/$d/*errors.txt; do printf '%s\n' "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null err="$?" - checktest "$d" "$err" "$line" "$out" "$exebase" + checkerrtest "$d" "$err" "$line" "$out" "$exebase" done < "$testfile" @@ -116,7 +126,7 @@ for testfile in $testdir/$d/errors/*.txt; do printf '%s\n' "$halt" | "$exe" "$@" $opts "$testfile" 2> "$out" > /dev/null err="$?" - checktest "$d" "$err" "$testfile" "$out" "$exebase" + checkerrtest "$d" "$err" "$testfile" "$out" "$exebase" printf 'pass\n' diff --git a/contrib/bc/tests/extra_required.txt b/contrib/bc/tests/extra_required.txt new file mode 100644 index 000000000000..a87a9a0aacf2 --- /dev/null +++ b/contrib/bc/tests/extra_required.txt @@ -0,0 +1,7 @@ +engineering +lib2 +places +rand +scientific +shift +trunc diff --git a/contrib/bc/tests/fuzzing/bc.dict b/contrib/bc/tests/fuzzing/bc.dict new file mode 100644 index 000000000000..f4dc965844e1 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc.dict @@ -0,0 +1,68 @@ +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +# AFL dictionary for bc +# + +keyword_abs="abs" +keyword_auto="auto" +keyword_break="break" +keyword_continue="continue" +keyword_define="define" +keyword_else="else" +keyword_for="for" +keyword_halt="halt" +keyword_ibase="ibase" +keyword_if="if" +keyword_irand="irand" +keyword_last="last" +keyword_length="length" +keyword_limits="limits" +keyword_maxibase="maxibase" +keyword_maxobase="maxobase" +keyword_maxrand="maxrand" +keyword_maxscale="maxscale" +keyword_obase="obase" +keyword_print="print" +keyword_quit="quit" +keyword_rand="rand" +keyword_read="read" +keyword_return="return" +keyword_scale="scale" +keyword_seed="seed" +keyword_sqrt="sqrt" +keyword_while="while" + +"{" +"}" +"," +"[" +"]" +"1" +"1.234" +"-3.2892" +"3e4" diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/abs.txt b/contrib/bc/tests/fuzzing/bc_inputs1/abs.txt new file mode 100644 index 000000000000..ffb7aba65c3b --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/abs.txt @@ -0,0 +1,7 @@ +abs(0) +abs(1) +abs(.289365) +abs(289.82937658) +abs(-19) +abs(-.2098180) +abs(-198289.1098376) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/add.txt b/contrib/bc/tests/fuzzing/bc_inputs1/add.txt new file mode 100644 index 000000000000..647781732c63 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/add.txt @@ -0,0 +1,146 @@ +0 + 0 +0 + 1 +1 + 1 +1 + 0 +2 + 5 +237 + 483 +999 + 999 +2374623 + 324869356734856 +2378639084586723980562 + 23468729367839 +37298367203972395108367910823465293084561329084561390845613409516734503870691837451 + 785621394067928346918023476190834672198467134908618723249671349062187346898241093486139046139084613490817356023871869102746182749061872609129847 +1.1 + 0 +0 + 1.1 +457283.731284923576 + 37842934672834.3874629385672354 +1.0 + 0.1 +3746289134067138046 + 0.138375863945672398456712389456273486293 +-1 + -1 +-4 + -15 +-1346782 + -1287904651762468913476 +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 + 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005 +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999899999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +99999999999999999999999999999999999989999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 + 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +-1889985797 + 2012747315 +0 + -14338.391079082 +-2422297 + 1.3134942556 +182039471029834 + 282039471029834 +282039471029834 + 182039471029834 +182039471029834.2801722893 + 282039471029834 +282039471029834.2801722893 + 182039471029834 +182039471029834.2801722893 + 282039471029834.2838 +282039471029834.2801722893 + 182039471029834.2838 +182039471029834 + 282039471029834.2801722893 +282039471029834 + 182039471029834.2801722893 +182039471029834.8297282893 + 282039471029834.2801722893 +282039471029834.8297282893 + 182039471029834.2801722893 +471029834 + 282039471029834 +471029834 + 182039471029834 +471029834.2801722893 + 282039471029834 +471029834.2801722893 + 182039471029834 +471029834.2801722893 + 282039471029834.2838 +471029834.2801722893 + 182039471029834.2838 +471029834 + 282039471029834.2801722893 +471029834 + 182039471029834.2801722893 +471029834.8297282893 + 282039471029834.2801722893 +471029834.8297282893 + 182039471029834.2801722893 +182039471029834 + 471029834 +282039471029834 + 471029834 +182039471029834.2801722893 + 471029834 +282039471029834.2801722893 + 471029834 +182039471029834.2801722893 + 471029834.2838 +282039471029834.2801722893 + 471029834.2838 +182039471029834 + 471029834.2801722893 +282039471029834 + 471029834.2801722893 +182039471029834.8297282893 + 471029834.2801722893 +282039471029834.8297282893 + 471029834.2801722893 +-182039471029834 + 282039471029834 +-282039471029834 + 182039471029834 +-182039471029834.2801722893 + 282039471029834 +-282039471029834.2801722893 + 182039471029834 +-182039471029834.2801722893 + 282039471029834.2838 +-282039471029834.2801722893 + 182039471029834.2838 +-182039471029834 + 282039471029834.2801722893 +-282039471029834 + 182039471029834.2801722893 +-182039471029834.8297282893 + 282039471029834.2801722893 +-282039471029834.8297282893 + 182039471029834.2801722893 +-471029834 + 282039471029834 +-471029834 + 182039471029834 +-471029834.2801722893 + 282039471029834 +-471029834.2801722893 + 182039471029834 +-471029834.2801722893 + 282039471029834.2838 +-471029834.2801722893 + 182039471029834.2838 +-471029834 + 282039471029834.2801722893 +-471029834 + 182039471029834.2801722893 +-471029834.8297282893 + 282039471029834.2801722893 +-471029834.8297282893 + 182039471029834.2801722893 +-182039471029834 + 471029834 +-282039471029834 + 471029834 +-182039471029834.2801722893 + 471029834 +-282039471029834.2801722893 + 471029834 +-182039471029834.2801722893 + 471029834.2838 +-282039471029834.2801722893 + 471029834.2838 +-182039471029834 + 471029834.2801722893 +-282039471029834 + 471029834.2801722893 +-182039471029834.8297282893 + 471029834.2801722893 +-282039471029834.8297282893 + 471029834.2801722893 +182039471029834 + -282039471029834 +282039471029834 + -182039471029834 +182039471029834.2801722893 + -282039471029834 +282039471029834.2801722893 + -182039471029834 +182039471029834.2801722893 + -282039471029834.2838 +282039471029834.2801722893 + -182039471029834.2838 +182039471029834 + -282039471029834.2801722893 +282039471029834 + -182039471029834.2801722893 +182039471029834.8297282893 + -282039471029834.2801722893 +282039471029834.8297282893 + -182039471029834.2801722893 +471029834 + -282039471029834 +471029834 + -182039471029834 +471029834.2801722893 + -282039471029834 +471029834.2801722893 + -182039471029834 +471029834.2801722893 + -282039471029834.2838 +471029834.2801722893 + -182039471029834.2838 +471029834 + -282039471029834.2801722893 +471029834 + -182039471029834.2801722893 +471029834.8297282893 + -282039471029834.2801722893 +471029834.8297282893 + -182039471029834.2801722893 +182039471029834 + -471029834 +282039471029834 + -471029834 +182039471029834.2801722893 + -471029834 +282039471029834.2801722893 + -471029834 +182039471029834.2801722893 + -471029834.2838 +282039471029834.2801722893 + -471029834.2838 +182039471029834 + -471029834.2801722893 +282039471029834 + -471029834.2801722893 +182039471029834.8297282893 + -471029834.2801722893 +282039471029834.8297282893 + -471029834.2801722893 +-182039471029834 + -282039471029834 +-282039471029834 + -182039471029834 +-182039471029834.2801722893 + -282039471029834 +-282039471029834.2801722893 + -182039471029834 +-182039471029834.2801722893 + -282039471029834.2838 +-282039471029834.2801722893 + -182039471029834.2838 +-182039471029834 + -282039471029834.2801722893 +-282039471029834 + -182039471029834.2801722893 +-182039471029834.8297282893 + -282039471029834.2801722893 +-282039471029834.8297282893 + -182039471029834.2801722893 +-471029834 + -282039471029834 +-471029834 + -182039471029834 +-471029834.2801722893 + -282039471029834 +-471029834.2801722893 + -182039471029834 +-471029834.2801722893 + -282039471029834.2838 +-471029834.2801722893 + -182039471029834.2838 +-471029834 + -282039471029834.2801722893 +-471029834 + -182039471029834.2801722893 +-471029834.8297282893 + -282039471029834.2801722893 +-471029834.8297282893 + -182039471029834.2801722893 +-182039471029834 + -471029834 +-282039471029834 + -471029834 +-182039471029834.2801722893 + -471029834 +-282039471029834.2801722893 + -471029834 +-182039471029834.2801722893 + -471029834.2838 +-282039471029834.2801722893 + -471029834.2838 +-182039471029834 + -471029834.2801722893 +-282039471029834 + -471029834.2801722893 +-182039471029834.8297282893 + -471029834.2801722893 +-282039471029834.8297282893 + -471029834.2801722893 diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt b/contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt new file mode 100644 index 000000000000..f665ea90b728 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/arctangent.txt @@ -0,0 +1,26 @@ +a(.267) +a(1) +scale = 64 +a(.267) +a(1) +scale = 100 +a(.267) +a(1) +scale = 20 +a(0) +a(.5) +a(0.577350269189625764509148780501) +a(1.5) +a(1.7320508075688772935274463415) +a(2) +a(3) +a(1000) +a(-.5) +a(-0.577350269189625764509148780501) +a(-1.5) +a(-1.7320508075688772935274463415) +a(-2) +a(-3) +a(-1000) +a(-3249917614.2821897119) +a(-694706362.1974670468) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/array.bc b/contrib/bc/tests/fuzzing/bc_inputs1/array.bc new file mode 100755 index 000000000000..dac232804914 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/array.bc @@ -0,0 +1,60 @@ +#! /usr/bin/bc -q + +define z(a[]) { + for (i = 0; i < l; ++i) { + a[i] + } +} + +define x(a[]) { + + # Test for separate vars and arrays. + auto a + + for (a = 0; a < l; ++a) { + a[a] = -a + } + + z(a[]) +} + +define g(x[], y[]) { + return x[0] - y[0] +} + +define h(y[], x[]) { + return g(x[], y[]) +} + +define m(*x[], *y[]) { + return x[0] / y[0] +} + +define n(*y[], *x[]) { + return m(x[], y[]) +} + +for (i = 0; i < 101; ++i) { + a[i] = i +} + +a[104] = 204 + +l = length(a[]) + +for (i = 0; i <= l; ++i) { + a[i] +} + +z(a[]) +x(a[]) +z(a[]) +l + +x[0] = 5 +y[0] = 4 + +h(x[], y[]) +n(x[], y[]) + +halt diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt b/contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt new file mode 100644 index 000000000000..26a284b8d814 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/arrays.txt @@ -0,0 +1,10 @@ +a[0] = 1 +a[2-1] = 2 + +a[0]+a[0] + +a[2-1]+a[2-1] + +a[5] = 2 +a[5.789] + diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt b/contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt new file mode 100644 index 000000000000..6a776e7840ec --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/assignments.txt @@ -0,0 +1,122 @@ +define x(x) { + return (i++ + x) +} +define y(x) { + return (++i + x) +} +define z(x) { + return (i *= 2) + x +} + +i++ +i-- +++i +--i + +(i++) +(i--) +(++i) +(--i) + +i += 1 +i +i -= -4 +i +i *= 5 +i +i /= 12.5 +i + +i = 0 + +(i += 1) +(i -= -4) +(i *= 5) +(i /= 12.5) + +i = 0 + +a[i++] += ++i +i-- +i-- +i +a[i] + +a[i]++ +a[i]-- +++a[i] +--a[i] + +i += 4 +i + +sqrt(i *= 4) +i +length(i /= 2) +i + +i = 4 +scale(i /= 2) +i + +i = -1 + +abs(i--) +abs(--i) +abs(++i) +abs(i++) + +i = -i + +a = 4 + +x(a) +i + +x(a *= 5) +a +i + +a = 4 + +y(a) +i + +y(a -= 2) +a +i + +a = 4 + +z(a) +i + +z(a /= 0.5) +a +i + +i = 1 + +if (i -= 1) print "true\n" +else print "false\n" + +if (i += 1) print "true\n" +else print "false\n" + +i = 3 + +while (i -= 2) print "i: ", i += 1, "\n" + +a = 5 + +for (i = 5; i-= 1; --a) print "i: ", i, "; a: ", a, "\n" + +define void t(x, y) { + print "x: ", x, "; y: ", y, "\n" +} + +t(i++, i++) +i + +t(++i, ++i) +i diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/basic.txt b/contrib/bc/tests/fuzzing/bc_inputs1/basic.txt new file mode 100644 index 000000000000..f3d957a26635 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/basic.txt @@ -0,0 +1,7 @@ +scale=10;123981239.981273987 * 12983791827398.29836472638 +scale=100;759634576394.3946587934658364895 / 9834759834895386.36459364958346 +34895734986539489834759837489573498573.398475984759837485734987598345 + 9823749832749872384234872934.28347982374987239847982374 +a=123123123.987239874; b=123123123.239479823748; a+b +20347023.23498723984 - 28934723874.234720384 +scale=100;a=739534985.895347284957;b=238746782364.2374623784; c = a / b; c+0 + diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt b/contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt new file mode 100644 index 000000000000..e26ded34bd1d --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/boolean.txt @@ -0,0 +1,184 @@ +!0 +!1 +!(-129) +4 && 5 +4 && 0 +0 && 5 +4 && 5 && 7 +4 && 0 && 7 +0 && 5 && 7 +4 && 5 && 0 +0 && 0 && 7 +4 && 0 && 0 +0 && 5 && 0 +!4 && 5 +!4 && 0 +!0 && 5 +4 && !5 +4 && !0 +0 && !5 +!4 && 5 && 7 +!4 && 0 && 7 +!0 && 5 && 7 +!4 && 5 && 0 +!0 && 0 && 7 +!4 && 0 && 0 +!0 && 5 && 0 +4 && !5 && 7 +4 && !0 && 7 +0 && !5 && 7 +4 && !5 && 0 +0 && !0 && 7 +4 && !0 && 0 +0 && !5 && 0 +4 && 5 && !7 +4 && 0 && !7 +0 && 5 && !7 +4 && 5 && !0 +0 && 0 && !7 +4 && 0 && !0 +0 && 5 && !0 +!4 && !5 && 7 +!4 && !0 && 7 +!0 && !5 && 7 +!4 && !5 && 0 +!0 && !0 && 7 +!4 && !0 && 0 +!0 && !5 && 0 +!4 && 5 && !7 +!4 && 0 && !7 +!0 && 5 && !7 +!4 && 5 && !0 +!0 && 0 && !7 +!4 && 0 && !0 +!0 && 5 && !0 +4 && !5 && !7 +4 && !0 && !7 +0 && !5 && !7 +4 && !5 && !0 +0 && !0 && !7 +4 && !0 && !0 +0 && !5 && !0 +!4 && !5 && !7 +!4 && !0 && !7 +!0 && !5 && !7 +!4 && !5 && !0 +!0 && !0 && !7 +!4 && !0 && !0 +!0 && !5 && !0 +3 < 4 && 7 +3 && 4 >= 4 +3 > 4 && 7 +3 && 4 >= 5 +3 < 4 && 0 +0 && 4 >= 4 +3 > 4 && 0 +0 && 4 >= 5 +3 > 4 && 0 +0 && 4 < 4 +3 >= 4 && 0 +0 && 4 >= 5 +3 < 4 && 7 +3 && 4 >= 4 +3 > 4 && 7 > 4 +3 >= 2 && 4 >= 5 +3 < 4 && 0 > -1 +4 < 3 && 4 >= 4 +3 > 4 && 3 == 3 +3 != 3 && 4 >= 5 +3 > 4 && 0 > 1 +0 >= 0 && 4 < 4 +3 >= 4 && 0 >= 1 +0 <= -1 && 4 >= 5 +4 || 5 +4 || 0 +0 || 5 +4 || 5 || 7 +4 || 0 || 7 +0 || 5 || 7 +4 || 5 || 0 +0 || 0 || 7 +4 || 0 || 0 +0 || 5 || 0 +!4 || 5 +!4 || 0 +!0 || 5 +4 || !5 +4 || !0 +0 || !5 +!4 || 5 || 7 +!4 || 0 || 7 +!0 || 5 || 7 +!4 || 5 || 0 +!0 || 0 || 7 +!4 || 0 || 0 +!0 || 5 || 0 +4 || !5 || 7 +4 || !0 || 7 +0 || !5 || 7 +4 || !5 || 0 +0 || !0 || 7 +4 || !0 || 0 +0 || !5 || 0 +4 || 5 || !7 +4 || 0 || !7 +0 || 5 || !7 +4 || 5 || !0 +0 || 0 || !7 +4 || 0 || !0 +0 || 5 || !0 +!4 || !5 || 7 +!4 || !0 || 7 +!0 || !5 || 7 +!4 || !5 || 0 +!0 || !0 || 7 +!4 || !0 || 0 +!0 || !5 || 0 +!4 || 5 || !7 +!4 || 0 || !7 +!0 || 5 || !7 +!4 || 5 || !0 +!0 || 0 || !7 +!4 || 0 || !0 +!0 || 5 || !0 +4 || !5 || !7 +4 || !0 || !7 +0 || !5 || !7 +4 || !5 || !0 +0 || !0 || !7 +4 || !0 || !0 +0 || !5 || !0 +!4 || !5 || !7 +!4 || !0 || !7 +!0 || !5 || !7 +!4 || !5 || !0 +!0 || !0 || !7 +!4 || !0 || !0 +!0 || !5 || !0 +3 < 4 || 7 +3 || 4 >= 4 +3 > 4 || 7 +3 || 4 >= 5 +3 < 4 || 0 +0 || 4 >= 4 +3 > 4 || 0 +0 || 4 >= 5 +3 > 4 || 0 +0 || 4 < 4 +3 >= 4 || 0 +0 || 4 >= 5 +3 < 4 || 7 +3 || 4 >= 4 +3 > 4 || 7 > 4 +3 >= 2 || 4 >= 5 +3 < 4 || 0 > -1 +4 < 3 || 4 >= 4 +3 > 4 || 3 == 3 +3 != 3 || 4 >= 5 +3 > 4 || 0 > 1 +0 >= 0 || 4 < 4 +3 >= 4 || 0 >= 1 +0 <= -1 || 4 >= 5 +1 <= 0 && 1 <= 2 || 1 >= 0 && 1 == 2 +1 <= 0 && 1 <= 2 || 1 >= 0 && 1 != 2 +1 >= 0 && 1 <= 2 || 1 >= 0 && 1 == 2 diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt b/contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt new file mode 100644 index 000000000000..9e67df4c6f69 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/cosine.txt @@ -0,0 +1,44 @@ +scale = 25 +p = 4 * a(1) +scale = 20 +c(0) +c(0.5) +c(1) +c(2) +c(3) +c(-0.5) +c(-1) +c(-2) +c(-3) +c(p / 7) +c(-p / 7) +c(p / 4) +c(-p / 4) +c(p / 3) +c(-p / 3) +c(p / 2) +c(-p / 2) +c(3 * p / 4) +c(3 * -p / 4) +c(p) +c(-p) +c(3 * p / 2) +c(3 * -p / 2) +c(7 * p / 4) +c(7 * -p / 4) +c(13 * p / 4) +c(13 * -p / 4) +c(2 * p) +c(2 * -p) +c(131231) +c(-131231) +c(859799894.3562378245) +c(859799894.3562378245) +c(4307371) +c(3522556.3323810191) +c(44961070) +c(6918619.1574479809) +c(190836996.2180244164) +c(34934) +c(2483599) +c(13720376) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt b/contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt new file mode 100644 index 000000000000..5c6bd327c1a8 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/decimal.txt @@ -0,0 +1,35 @@ +0 +0.0 +000000000000000000000000.00000000000000000000000 +000000000000000000000000000135482346782356 +000000000000000000000000002 +1 +11 +123 +7505 +1023468723275435238491972521917846 +4343472432431705867392073517038270398027352709027389273920739037937960379637893607893607893670530278200795207952702873892786172916728961783907893607418973587857386079679267926737520730925372983782793652793 +-1 +-203 +-57 +-18586 +-31378682943772818461924738352952347258 +-823945628745673589495067238723986520375698237620834674509627345273096287563846592384526349872634895763257893467523987578690283762897568459072348758071071087813501875908127359018715023841710239872301387278 +.123521346523546 +0.1245923756273856 +-.1024678456387 +-0.8735863475634587 +4.0 +-6.0 +234237468293576.000000000000000000000000000000 +23987623568943567.00000000000000000005677834650000000000000 +23856934568940675.000000000000000435676782300000000000000456784 +77567648698496.000000000000000000587674750000000000458563800000000000000 +2348672354968723.2374823546000000000003256987394502346892435623870000000034578 +-2354768.000000000000000000000000000000000000 +-96739874567.000000000347683456 +-3764568345.000000000004573845000000347683460 +-356784356.934568495770004586495678300000000 +74325437345273852773827101738273127312738521733017537073520735207307570358738257390761276072160719802671980267018728630178.7082681027680521760217867841276127681270867827821768173178207830710978017738178678012767377058785378278207385237085237803278203782037237582795870 +-756752732785273851273728537852738257837283678965738527385272983678372867327835672967385278372637862738627836279863782673862783670.71738178361738718367186378610738617836781603760178367018603760178107735278372832783728367826738627836278378260736270367362073867097307925 +9812734012837410982345719208345712908357412903587192048571920458712.23957182459817249058172945781 diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/divide.txt b/contrib/bc/tests/fuzzing/bc_inputs1/divide.txt new file mode 100644 index 000000000000..4d0caddc9b52 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/divide.txt @@ -0,0 +1,31 @@ +0 / 1 +0 / 321566 +0 / 0.3984567238456 +1 / 1 +1 / 1287469297356 +1 / 0.2395672438567234 +1 / 237586239856.0293596728392360 +1249687284356 / 3027949207835207 +378617298617396719 / 35748521 +9348576237845624358 / 0.9857829375461 +35768293846193284 / 2374568947.045762839567823 +-78987234567812345 / 876542837618936 +-356789237555535468 / 0.3375273860984786903 +-5203475364850390 / 435742903748307.70869378534043296404530458 +-0.37861723347576903 / 7385770896 +-0.399454682043962 / 0.34824389304 +-0.6920414523873204 / 356489645223.76076045304879030 +-35872917389671.7573280963748 / 73924708 +-78375896314.4836709876983 / 0.78356798637817 +-2374123896417.143789621437581 / 347821469423789.1473856783960 +-896729350238549726 / -34976289345762 +-2374568293458762348596 / -0.8792370647234987679 +-237584692306721845726038 / -21783910782374529637.978102738746189024761 +-0.23457980123576298375682 / -1375486293874612 +-0.173897061862478951264 / -0.8179327486017634987516298745 +-0.9186739823576829347586 / -0.235678293458756239846 +-0.9375896183746982374568 / -13784962873546.0928729395476283745 +-2930754618923467.12323745862937465 / -734869238465 +-23745861923467.874675129834675 / -0.23542357869124756 +-3878923750692883.7238596702834756902 / -7384192674957215364986723.9738461923487621983 +1 / 0.00000000000000000000000000000000000000000002346728372937352457354204563027 diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt b/contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt new file mode 100644 index 000000000000..cf9c0c1b0117 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/engineering.txt @@ -0,0 +1,19 @@ +obase=1 +0 +1 +-34 +298 +-8933 +29488 +-148232 +8927559 +.2 +-.02 +.002 +-.0003 +.0000209310 +-.00000289362 +.000000859289 +-.02983672 +.20201296 +-.8907210897000000000000000000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt b/contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt new file mode 100644 index 000000000000..40bcf3c5a585 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/exponent.txt @@ -0,0 +1,22 @@ +e(0) +e(0.5) +e(1) +e(1.5) +e(1.74) +e(2) +e(3.2345) +e(5.283957) +e(13.23857) +e(100) +e(283.238957) +e(-0.5) +e(-1) +e(-1.5) +e(-1.74) +e(-2) +e(-3.2345) +e(-5.283957) +e(-13.23857) +e(-100) +e(-283.238957) +e(142.749502399) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/functions.bc b/contrib/bc/tests/fuzzing/bc_inputs1/functions.bc new file mode 100644 index 000000000000..80d6d1623d8d --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/functions.bc @@ -0,0 +1,7 @@ +e(0.5) + +define e(x) { + return x +} + +e(0.5) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/functions.txt b/contrib/bc/tests/fuzzing/bc_inputs1/functions.txt new file mode 100644 index 000000000000..5e540ed66a11 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/functions.txt @@ -0,0 +1,13 @@ +define x(x, y) { + return x - y + 5 +} + +define y(y, x) { + return x(y, x) + x(x, y) +} + +y(1, 4) +y(2, 4) +y(3, 4) +y(4, 3) +y(3, 2) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/globals.txt b/contrib/bc/tests/fuzzing/bc_inputs1/globals.txt new file mode 100644 index 000000000000..4b20f5725864 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/globals.txt @@ -0,0 +1,21 @@ +define i(x) { + ibase=x + return ibase +} + +define o(x) { + obase=x + return obase +} + +define r(x) { + scale=x + return scale +} + +i(11) +ibase +o(12) +obase +r(15) +scale diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/len.bc b/contrib/bc/tests/fuzzing/bc_inputs1/len.bc new file mode 100644 index 000000000000..ec931f2386a5 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/len.bc @@ -0,0 +1,48 @@ +define fast_gcd(a, b) { + + if (a == b) return a; + if (a > b) return fast_gcd(a - b, b) + + return fast_gcd(a, b - a); +} + +define void r_reduce(*r[]) { + + auto g,s; + + if (length(r[]) != 2) sqrt(-1); + if (scale(r[0])) 2^r[0]; + if (scale(r[1])) 2^r[1]; + + if (r[0] >= 0 && r[1] >= 0) g = fast_gcd(r[0], r[1]); + else g = gcd(r[0], r[1]); + + s = scale; + scale = 0; + + r[0] /= g; + r[1] /= g; + + scale = s; +} + +define void r_init(*r[], a, b) { + r[0] = a; + r[1] = b; + r_reduce(r[]); +} + +define void r_initi(*r[], i, a, b) { + + length(r[]); + + r[0] = i * b + a; + r[1] = b; + + length(r[]); + + r_reduce(r[]); +} + +length(a[]) +r_initi(a[], 5, 63, 94); diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/length.txt b/contrib/bc/tests/fuzzing/bc_inputs1/length.txt new file mode 100644 index 000000000000..48f83c95cf55 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/length.txt @@ -0,0 +1,59 @@ +length(0) +length(1) +length(12) +length(123) +length(1234) +length(12345) +length(123456) +length(1234567) +length(12345678) +length(123456789) +length(1234567890) +length(1.0) +length(12.0) +length(123.0) +length(1234.0) +length(12345.0) +length(123456.0) +length(1234567.0) +length(12345678.0) +length(123456789.0) +length(1234567890.0) +length(.1) +length(.12) +length(.123) +length(.1234) +length(.12345) +length(.123456) +length(.1234567) +length(.12345678) +length(.123456789) +length(.1234567890) +length(.01) +length(.012) +length(.0123) +length(.01234) +length(.012345) +length(.0123456) +length(.01234567) +length(.012345678) +length(.0123456789) +length(.01234567890) +length(.0000000001) +length(.00000000012) +length(.000000000123) +length(.0000000001234) +length(.00000000012345) +length(.000000000123456) +length(.0000000001234567) +length(.00000000012345678) +length(.000000000123456789) +length(.0000000001234567890) +length(289.29837) +length(2893.00000) +length(289.0) +length(1802973.0000000238) +length(.000000000000000093182394080000000000) +a[0] = 0 +a[5] = 0 +length(a[]) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt new file mode 100644 index 000000000000..7aa3fda19cc7 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib10.txt @@ -0,0 +1,4 @@ +l10(0) +l10(99) +l10(100) +l10(-100) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt new file mode 100644 index 000000000000..5bb262bd2668 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib11.txt @@ -0,0 +1,4 @@ +perm(10, 2) +comb(10, 2) +perm(6, 2) +comb(6, 2) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt new file mode 100644 index 000000000000..7d70e1ccdd5e --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib12.txt @@ -0,0 +1 @@ +uint(0) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt new file mode 100644 index 000000000000..f345bd1669cb --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib2.txt @@ -0,0 +1,15 @@ +r(0, 0) +r(0, 1) +r(0, 100) +r(1, 0) +r(1, 3) +r(1.4, 0) +r(1.5, 0) +r(34.45, 2) +r(64.1223, 4) +r(-1, 0) +r(-1, 3) +r(-1.4, 0) +r(-1.5, 0) +r(-34.45, 2) +r(-64.1223, 4) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt new file mode 100644 index 000000000000..1da42385ea44 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib3.txt @@ -0,0 +1,6 @@ +f(0) +f(1) +f(2) +f(3) +f(4) +f(5) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt new file mode 100644 index 000000000000..9f5323375d30 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib4.txt @@ -0,0 +1,10 @@ +binary(0) +hex(0) +binary(1) +hex(1) +binary(2) +hex(2) +binary(15) +hex(15) +binary(16) +hex(16) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt new file mode 100644 index 000000000000..c69a49167292 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib5.txt @@ -0,0 +1,2 @@ +uint32(2147483647) +int32(2147483647) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt new file mode 100644 index 000000000000..260e159f9fb6 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib6.txt @@ -0,0 +1,5 @@ +pi(5) +p=pi(scale) +r2d(-p) +d2r(180) +d2r(-180) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt new file mode 100644 index 000000000000..edd66a40e83a --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib7.txt @@ -0,0 +1,12 @@ +ubytes(0) +ubytes(1) +ubytes(2) +sbytes(0) +sbytes(1) +sbytes(-1) +sbytes(2) +sbytes(127) +sbytes(128) +sbytes(254) +sbytes(255) +sbytes(256) diff --git a/contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt b/contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt new file mode 100644 index 000000000000..a4cc720c4754 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs1/lib8.txt @@ -0,0 +1,3 @@ +l2(0) +l2(8) +l2(-8) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt new file mode 100644 index 000000000000..f7957ddc81fb --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib13.txt @@ -0,0 +1 @@ +uint(-3) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt new file mode 100644 index 000000000000..a07d4730c269 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib14.txt @@ -0,0 +1 @@ +uint64(2147483647) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt new file mode 100644 index 000000000000..13be33145ba3 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib15.txt @@ -0,0 +1 @@ +uint(1) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt new file mode 100644 index 000000000000..de8dff5e7fee --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib16.txt @@ -0,0 +1 @@ +uint(2147483647) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt new file mode 100644 index 000000000000..95fdd40264fa --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib19.txt @@ -0,0 +1 @@ +int(4294967296) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt new file mode 100644 index 000000000000..8872f9b5f8e1 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib20.txt @@ -0,0 +1 @@ +int(-4294967296) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt new file mode 100644 index 000000000000..82693695945d --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib21.txt @@ -0,0 +1 @@ +int(1) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt new file mode 100644 index 000000000000..438575ef5b7c --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib22.txt @@ -0,0 +1 @@ +int(-1) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt new file mode 100644 index 000000000000..df3d64009e79 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib23.txt @@ -0,0 +1 @@ +uint(3.928375) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt b/contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt new file mode 100644 index 000000000000..01c7181e5133 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/lib24.txt @@ -0,0 +1 @@ +int(4.000000) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/log.txt b/contrib/bc/tests/fuzzing/bc_inputs2/log.txt new file mode 100644 index 000000000000..54115e380ec7 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/log.txt @@ -0,0 +1,22 @@ +l(0) +l(0.5) +l(1) +l(1.5) +l(1.74) +l(2) +l(3.2345) +l(5.283957) +l(13.23857) +l(100) +l(283.238957) +l(-0.5) +l(-1) +l(-1.5) +l(-1.74) +l(-2) +l(-3.2345) +l(-5.283957) +l(-13.23857) +l(-100) +l(-283.238957) +l(10430710.3325472917) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/misc.txt b/contrib/bc/tests/fuzzing/bc_inputs2/misc.txt new file mode 100644 index 000000000000..571f4a87e262 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/misc.txt @@ -0,0 +1,13 @@ +4.1*1.-13^ - 74 - 1284597623841*1.-13^ - 757 +4.1*1.\ +-1\ +3^ - 74 - 1284597623841*1.\ +-1\ +3^ - 757 +obase = 9 +4.1*1.-13^ - 74 - 1284597623841*1.-13^ - 757 +4.1*1.\ +-1\ +3^ - 74 - 1284597623841*1.\ +-1\ +3^ - 757 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt b/contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt new file mode 100644 index 000000000000..7e9d9660457f --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/misc1.txt @@ -0,0 +1,76 @@ +define x(x) { + return(x) +} +define y() { + return; +} +define z() { + return (); +} +scale = 0 +x=2 +x[0]=3 +x +x[0] +scale +ibase +obase +x ( 7 ) +x + x( 8 ) +x - x[0] +321 * x +2 ^ x[0] +x++ +--x +x += 9 +x +length(2381) +sqrt(9) +scale(238.1) +x=2 +x[0]=3 +(x) +(x[0]) +(scale) +(ibase) +(obase) +(x ( 7 )) +(x + x( 8 )) +(x - x[0]) +(321 * x) +(2 ^ x[0]) +(x++) +(--x) +(x += 9) +(length(2381)) +(sqrt(9)) +(scale(238.1)) +(scale = 0) +(x = 10) +(x += 100) +(x -= 10) +(x *= 10) +(x /= 100) +(x ^= 10) +(x = sqrt(x)) +(x[1 - 1]) +x[(1 - 1)] +2 + \ +3 +++ibase +--ibase +++obase +--obase +++last +--last +last +last = 100 +last +. = 150 +. +++scale +--scale +y() +z() +2 + /* +*/3 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt b/contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt new file mode 100644 index 000000000000..3b3aa683402c --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/misc2.txt @@ -0,0 +1,110 @@ +define w() { auto z; return 1; } +define x() { + "x" + return (1) +} +define y() { + "y" + return (2) +} +define z() { + "z" + return (3) +} + +define v() { return } + +v() + +w() + +if (x() == y()) { 1 } +1 +if (x() <= y()) { 2 } +if (y() >= x()) { 3 } +if (x() != y()) { 4 } +if (x() < y()) { 5 } +if (y() > x()) { 6 } + +if (x() == z()) { 11 } +11 +if (x() <= z()) { 12 } +if (z() >= x()) { 13 } +if (x() != z()) { 14 } +if (x() < z()) { 15 } +if (z() > x()) { 16 } + +x = -10 +while (x <= 0) { + x + if (x == -5) break; + x += 1 +} + +define u() { + auto a[]; + return a[0] +} + +u() + +if (x == -4) x +else x - 4 + +x = 1 + +if (x == 1) 1 else 2 +if (x == 0) 1 else 2 + +if (x == 1) 1 else if (x == 0) 2 else 3 +if (x == 0) 1 else if (x == 1) 2 else 3 +if (x == -1) 1 else if (x == 0) 2 else 3 + +if (x == 1) if (x != 0) 1 else 2 else 3 +if (x == 1) if (x == 0) 1 else 2 else 3 +if (x != 1) if (x == 0) 1 else 2 else 3 + +if (x == 1) while (x > 0) { x ; x -= 1 } else 0 +x = 1 +if (x == 0) while (x > 0) { x ; x -= 1 } else 0 + +if(x == 1) { + 11 + while(x == 1) { + 21 + while(x == 1) { + 31 + break + 32 + } + 22 + break + 23 + } + 12 +} +99 + +for (;;) { 123 ; break; } +for (i = 0;; ++i) { i ; if (i == 2) break; else i; } +for (i = 0;;!++i) { i ; if (i == 2) break; else i; } +for (i = 0;; ++i) { i ; if (i != 2) i else break } + +while (i > 0) if (i == 1) break else i-- +while (i < 3) if (i != 2) i++ else break + +for(i=1; i<=3; i++) { i; if(i==2) continue; print i,i,"\n" } + +print 1,2,3 +print "\n" + +ifz = 1 +ifz +++ifz +ifz++ +ifz + +{ + 4 + 5 +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt b/contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt new file mode 100644 index 000000000000..7aad374c4ef6 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/misc3.txt @@ -0,0 +1,12 @@ +for (i = 0; i < A; ++i) +{print "n" +if(1)if(1){3 +} +if(0)if(1){3 +} +else 4 +if(0){if(1){3 +}} +else 5 +{i} +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt b/contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt new file mode 100644 index 000000000000..965600c18a1d --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/modulus.txt @@ -0,0 +1,69 @@ +1 % 1 +2 % 1 +16 % 4 +15 % 4 +17 % 4 +2389473 % 5 +39240687239 % 1 +346728934 % 23958 +3496723859067234 % 298375462837546928347623059375486 +-1 % 1 +-2 % 1 +-47589634875689345 % 37869235 +-1274852934765 % 2387628935486273546 +-6324758963 % 237854962 +1 % -1 +2 % -1 +2 % -2 +2 % -3 +16 % 5 +15 % 5 +14 % 5 +89237423 % -237856923854 +123647238946 % -12467 +-1 % -1 +-2 % -1 +-2 % -2 +-2 % -3 +-13 % -7 +-14 % -7 +-15 % -7 +-12784956 % -32746 +-127849612 % -23712347682193 +scale = 0 +1 % 1 +2 % 1 +16 % 4 +15 % 4 +17 % 4 +2389473 % 5 +39240687239 % 1 +346728934 % 23958 +3496723859067234 % 298375462837546928347623059375486 +-1 % 1 +-2 % 1 +-47589634875689345 % 37869235 +-1274852934765 % 2387628935486273546 +-6324758963 % 237854962 +1 % -1 +2 % -1 +2 % -2 +2 % -3 +16 % 5 +15 % 5 +14 % 5 +89237423 % -237856923854 +123647238946 % -12467 +-1 % -1 +-2 % -1 +-2 % -2 +-2 % -3 +-13 % -7 +-14 % -7 +-15 % -7 +-12784956 % -32746 +-127849612 % -23712347682193 +-3191280681 % 641165986 +scale = 0; -899510228 % -2448300078.40314 +scale = 0; -7424863 % -207.2609738667 +scale = 0; 3769798918 % 0.6 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt b/contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt new file mode 100644 index 000000000000..f5efed91b17f --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/multiply.txt @@ -0,0 +1,40 @@ +0 * 0 +1 * 0 +0 * 1 +0 * 2498752389672835476 +873246913745129084576134 * 0 +1 * 472638590273489273456 +12374861230476103672835496 * 1 +1 * 1 +2 * 1 +1 * 2 +2 * 2 +3 * 14 +17 * 8 +1892467513846753 * 1872439821374591038746 +328962735862.2973546835638947635 * 1728465791348762356 +38745962374538.387427384672934867234 * 0.1932476528394672837568923754 +9878894576289457634856.2738627161689017387608947567654 * 37842939768237596237854203.29874372139852739126739621793162 +-1 * 1 +-1 * 2 +78893457 * -34876238956 +235678324957634 * -0.2349578349672389576 +-12849567821934 * 12738462937681 +1274861293467.927843682937462 * -28935678239 +2936077239872.12937462836 * -0.012842357682435762 +2387692387566.2378569237546 * -272189345628.123875629835876 +0.012348629356782835962 * -23487692356 +0.4768349567348675934 * -0.23756834576934857638495 +0.98748395367485962735486 * -4675839462354867.376834956738456 +-321784627934586 * -235762378596 +-32578623567892356 * -0.32567384579638456 +-35768232346876 * -2348672935602387620.28375682349576237856 +-0.2356728394765234 * -238759624356978 +-0.2345768212346780 * -0.235768124697074385948943532045 +-0.370873860736785306278630 * -7835678398607.7086378076867096270 +-78365713707.7089637863786730 * -738580798679306780 +-73867038956790490258249 * -0.7379862716391723672803679 +-378621971598721837710387 * -98465373878350798.09743896037963078560 +37164201 * 2931559660 +679468076118972457796560530571.46287161642138401685 * 93762.2836 +.000000000000000000000000001 * .0000000000000000000000001 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/pi.txt b/contrib/bc/tests/fuzzing/bc_inputs2/pi.txt new file mode 100644 index 000000000000..775545c873a8 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/pi.txt @@ -0,0 +1,4 @@ +for (i = 0; i <= 20; ++i) { + scale = i + 4 * a(1) +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/places.txt b/contrib/bc/tests/fuzzing/bc_inputs2/places.txt new file mode 100644 index 000000000000..d6f20a46462f --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/places.txt @@ -0,0 +1,19 @@ +0 @ 0 +1 @ 0 +2 @ 0 +0.0023896 @ 0 +1.298346 @ 0 +2.00000000 @ 0 +0.0023896 @ 3 +1.298346 @ 4 +2.00000000 @ 5 +289 @ 3 +18.34 @ 6 +-183.1 @ 0 +-23.238 @ 8 +-343.23 @ 2 +x = 89136.892348976 +x @= 7 +x +-.1897263 @ 0 +.1982365 @ 0 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/power.txt b/contrib/bc/tests/fuzzing/bc_inputs2/power.txt new file mode 100644 index 000000000000..5657cdd7b7d9 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/power.txt @@ -0,0 +1,44 @@ +0 ^ 0 +0 ^ 1 +0 ^ 1894 +1 ^ 0 +39746823 ^ 0 +0.238672983047682 ^ 0 +18394762374689237468.97354862973846 ^ 0 +1 ^ 1 +2 ^ 1 +18927361346 ^ 1 +0.23523785962738592635777 ^ 1 +328956734869213746.89782398457234 ^ 1 +8937 ^ 98 +0.124876812394 ^ 2396 +93762.2836 ^ 13 +1 ^ -1 +2 ^ -1 +10 ^ -1 +683734768 ^ -1 +38579623756.897937568235 ^ -1 +1 ^ -32467 +2 ^ -53 +23897 ^ -213 +-1 ^ 1 +-1 ^ 2 +-2 ^ 1 +-2 ^ 2 +-237 ^ 294 +-3746 ^ 28 +-0.3548 ^ 35 +-4267.234 ^ 37 +-326.3246 ^ 78 +-1 ^ -1 +-1 ^ -2 +-2 ^ -1 +-2 ^ -2 +-237 ^ -293 +-784 ^ -23 +-86 ^ -7 +-0.23424398 ^ -781 +-178.234786 ^ -879 +-1274.346 ^ -768 +0 ^ -251 +-0.2959371298 ^ 227 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/print2.txt b/contrib/bc/tests/fuzzing/bc_inputs2/print2.txt new file mode 100644 index 000000000000..7f65fbe4c106 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/print2.txt @@ -0,0 +1,194 @@ +define prnt(i) { + + obase = i - 1 + a + b + c + + obase = i + a + b + c + + return i +} + +define prnt2(i) { + + obase = i + 1 + a + b + c + + print "\n" + + return i * 10 +} + +a = 999999999999999999999999999999999999 +b = a + 1 +c = b + 1 + +i = 100 +i = prnt(i) + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 000\n" + print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 001\n" + print " 084 044 021 047 096 073 015 052 088 014 072 097 047 021 094 051 083\e\n 002\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 001 012 066 220 495 792 924 792 495 220 066 012 000\n" + print " 001 012 066 220 495 792 924 792 495 220 066 012 001\n" + print " 001 012 066 220 495 792 924 792 495 220 066 012 002\n" + print " 999 999 999 999 999 999 999 999 999 999 999 999\n" + print " 001 000 000 000 000 000 000 000 000 000 000 000 000\n" + print " 001 000 000 000 000 000 000 000 000 000 000 000 001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0000\n" + print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0001\n" + print " 0989 0065 0781 0494 0209 0923 0209 0494 0781 0065 0989 0002\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0000\n" + print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0001\n" + print " 0001 0009 0036 0084 0126 0126 0084 0036 0009 0002\n" + print " 9999 9999 9999 9999 9999 9999 9999 9999 9999\n" + print " 0001 0000 0000 0000 0000 0000 0000 0000 0000 0000\n" + print " 0001 0000 0000 0000 0000 0000 0000 0000 0000 0001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 09992 00035 09917 00125 09875 00083 09965 00008 09999\n" + print " 09992 00035 09917 00125 09875 00083 09965 00008 10000\n" + print " 09992 00035 09917 00125 09875 00083 09965 00009 00000\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 00010 00070 00210 00350 00350 00210 00070 00009\n" + print " 00010 00070 00210 00350 00350 00210 00070 00010\n" + print " 00010 00070 00210 00350 00350 00210 00070 00011\n" + print " 00009 99999 99999 99999 99999 99999 99999 99999\n" + print " 00010 00000 00000 00000 00000 00000 00000 00000\n" + print " 00010 00000 00000 00000 00000 00000 00000 00001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 000009 099931 000209 099651 000349 099791 000069 099990\n" + print " 000009 099931 000209 099651 000349 099791 000069 099991\n" + print " 000009 099931 000209 099651 000349 099791 000069 099992\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 000001 000006 000015 000020 000015 000006 000000\n" + print " 000001 000006 000015 000020 000015 000006 000001\n" + print " 000001 000006 000015 000020 000015 000006 000002\n" + print " 999999 999999 999999 999999 999999 999999\n" + print " 000001 000000 000000 000000 000000 000000 000000\n" + print " 000001 000000 000000 000000 000000 000000 000001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 0999995 0000014 0999981 0000014 0999995 0000000\n" + print " 0999995 0000014 0999981 0000014 0999995 0000001\n" + print " 0999995 0000014 0999981 0000014 0999995 0000002\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 0000010 0000050 0000100 0000100 0000050 0000009\n" + print " 0000010 0000050 0000100 0000100 0000050 0000010\n" + print " 0000010 0000050 0000100 0000100 0000050 0000011\n" + print " 0000009 9999999 9999999 9999999 9999999 9999999\n" + print " 0000010 0000000 0000000 0000000 0000000 0000000\n" + print " 0000010 0000000 0000000 0000000 0000000 0000001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 00000009 09999951 00000099 09999901 00000049 09999990\n" + print " 00000009 09999951 00000099 09999901 00000049 09999991\n" + print " 00000009 09999951 00000099 09999901 00000049 09999992\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 00010000 00040000 00060000 00040000 00009999\n" + print " 00010000 00040000 00060000 00040000 00010000\n" + print " 00010000 00040000 00060000 00040000 00010001\n" + print " 00009999 99999999 99999999 99999999 99999999\n" + print " 00010000 00000000 00000000 00000000 00000000\n" + print " 00010000 00000000 00000000 00000000 00000001\n" +} + +if (i + 1 <= maxobase()) { + i = prnt2(i) +} +else { + print " 000009999 099960001 000059999 099960001 000009999\n" + print " 000009999 099960001 000059999 099960001 000010000\n" + print " 000009999 099960001 000059999 099960001 000010001\n" + print "\n" + i *= 10 +} + +if (i <= maxobase()) { + i = prnt(i) +} +else { + print " 000000001 000000004 000000006 000000004 000000000\n" + print " 000000001 000000004 000000006 000000004 000000001\n" + print " 000000001 000000004 000000006 000000004 000000002\n" + print " 999999999 999999999 999999999 999999999\n" + print " 000000001 000000000 000000000 000000000 000000000\n" + print " 000000001 000000000 000000000 000000000 000000001\n" +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/references.bc b/contrib/bc/tests/fuzzing/bc_inputs2/references.bc new file mode 100755 index 000000000000..8188f17aa017 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/references.bc @@ -0,0 +1,408 @@ +#! /usr/bin/bc -q + +define printarray(a[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a[i] + } +} + +define a2(a[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a[i] = a[i] * a[i] + } + + printarray(a[], len) +} + +define a4(a__[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a__[i] = a__[i] * a__[i] + } + + printarray(a__[], len) +} + +define a6(*a__[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a__[i] = a__[i] * a__[i] + } + + printarray(a__[], len) +} + +define a1(*a[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a[i] = i + } + + a2(a[], len) + + printarray(a[], len) +} + +define a3(*a__[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a__[i] = i + } + + a4(a__[], len) + + printarray(a__[], len) +} + +define a5(*a__[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a__[i] = i + } + + a2(a__[], len) + + printarray(a__[], len) +} + +define a7(*a__[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a__[i] = i + } + + a6(a__[], len) + + printarray(a__[], len) +} + +len = 16 + +a1(a[], len) +printarray(a[], len) +a3(a[], len) +printarray(a[], len) +a5(a[], len) +printarray(a[], len) +a7(a[], len) +printarray(a[], len) + +a1(b[], len) +printarray(b[], len) +a3(b[], len) +printarray(b[], len) +a5(b[], len) +printarray(b[], len) +a7(b[], len) +printarray(b[], len) + +a1[0] = 0 +a2[0] = 0 +a3[0] = 0 +a4[0] = 0 +a5[0] = 0 +a6[0] = 0 +a7[0] = 0 +a8[0] = 0 +a9[0] = 0 +a10[0] = 0 +a11[0] = 0 +a12[0] = 0 +a13[0] = 0 +a14[0] = 0 +a15[0] = 0 +a16[0] = 0 +a17[0] = 0 +a18[0] = 0 +a19[0] = 0 +a20[0] = 0 +a21[0] = 0 +a22[0] = 0 +a23[0] = 0 +a24[0] = 0 +a25[0] = 0 +a26[0] = 0 +a27[0] = 0 +a28[0] = 0 +a29[0] = 0 +a30[0] = 0 +a31[0] = 0 +a32[0] = 0 +a33[0] = 0 +a34[0] = 0 +a35[0] = 0 +a36[0] = 0 +a37[0] = 0 +a38[0] = 0 +a39[0] = 0 +a40[0] = 0 +a41[0] = 0 +a42[0] = 0 +a43[0] = 0 +a44[0] = 0 +a45[0] = 0 +a46[0] = 0 +a47[0] = 0 +a48[0] = 0 +a49[0] = 0 +a50[0] = 0 +a51[0] = 0 +a52[0] = 0 +a53[0] = 0 +a54[0] = 0 +a55[0] = 0 +a56[0] = 0 +a57[0] = 0 +a58[0] = 0 +a59[0] = 0 +a60[0] = 0 +a61[0] = 0 +a62[0] = 0 +a63[0] = 0 +a64[0] = 0 +a65[0] = 0 +a66[0] = 0 +a67[0] = 0 +a68[0] = 0 +a69[0] = 0 +a70[0] = 0 +a71[0] = 0 +a72[0] = 0 +a73[0] = 0 +a74[0] = 0 +a75[0] = 0 +a76[0] = 0 +a77[0] = 0 +a78[0] = 0 +a79[0] = 0 +a80[0] = 0 +a81[0] = 0 +a82[0] = 0 +a83[0] = 0 +a84[0] = 0 +a85[0] = 0 +a86[0] = 0 +a87[0] = 0 +a88[0] = 0 +a89[0] = 0 +a90[0] = 0 +a91[0] = 0 +a92[0] = 0 +a93[0] = 0 +a94[0] = 0 +a95[0] = 0 +a96[0] = 0 +a97[0] = 0 +a98[0] = 0 +a99[0] = 0 +a100[0] = 0 +a101[0] = 0 +a102[0] = 0 +a103[0] = 0 +a104[0] = 0 +a105[0] = 0 +a106[0] = 0 +a107[0] = 0 +a108[0] = 0 +a109[0] = 0 +a110[0] = 0 +a111[0] = 0 +a112[0] = 0 +a113[0] = 0 +a114[0] = 0 +a115[0] = 0 +a116[0] = 0 +a117[0] = 0 +a118[0] = 0 +a119[0] = 0 +a120[0] = 0 +a121[0] = 0 +a122[0] = 0 +a123[0] = 0 +a124[0] = 0 +a125[0] = 0 +a126[0] = 0 +a127[0] = 0 +a128[0] = 0 +a129[0] = 0 +a130[0] = 0 +a131[0] = 0 +a132[0] = 0 +a133[0] = 0 +a134[0] = 0 +a135[0] = 0 +a136[0] = 0 +a137[0] = 0 +a138[0] = 0 +a139[0] = 0 +a140[0] = 0 +a141[0] = 0 +a142[0] = 0 +a143[0] = 0 +a144[0] = 0 +a145[0] = 0 +a146[0] = 0 +a147[0] = 0 +a148[0] = 0 +a149[0] = 0 +a150[0] = 0 +a151[0] = 0 +a152[0] = 0 +a153[0] = 0 +a154[0] = 0 +a155[0] = 0 +a156[0] = 0 +a157[0] = 0 +a158[0] = 0 +a159[0] = 0 +a160[0] = 0 +a161[0] = 0 +a162[0] = 0 +a163[0] = 0 +a164[0] = 0 +a165[0] = 0 +a166[0] = 0 +a167[0] = 0 +a168[0] = 0 +a169[0] = 0 +a170[0] = 0 +a171[0] = 0 +a172[0] = 0 +a173[0] = 0 +a174[0] = 0 +a175[0] = 0 +a176[0] = 0 +a177[0] = 0 +a178[0] = 0 +a179[0] = 0 +a180[0] = 0 +a181[0] = 0 +a182[0] = 0 +a183[0] = 0 +a184[0] = 0 +a185[0] = 0 +a186[0] = 0 +a187[0] = 0 +a188[0] = 0 +a189[0] = 0 +a190[0] = 0 +a191[0] = 0 +a192[0] = 0 +a193[0] = 0 +a194[0] = 0 +a195[0] = 0 +a196[0] = 0 +a197[0] = 0 +a198[0] = 0 +a199[0] = 0 +a200[0] = 0 +a201[0] = 0 +a202[0] = 0 +a203[0] = 0 +a204[0] = 0 +a205[0] = 0 +a206[0] = 0 +a207[0] = 0 +a208[0] = 0 +a209[0] = 0 +a210[0] = 0 +a211[0] = 0 +a212[0] = 0 +a213[0] = 0 +a214[0] = 0 +a215[0] = 0 +a216[0] = 0 +a217[0] = 0 +a218[0] = 0 +a219[0] = 0 +a220[0] = 0 +a221[0] = 0 +a222[0] = 0 +a223[0] = 0 +a224[0] = 0 +a225[0] = 0 +a226[0] = 0 +a227[0] = 0 +a228[0] = 0 +a229[0] = 0 +a230[0] = 0 +a231[0] = 0 +a232[0] = 0 +a233[0] = 0 +a234[0] = 0 +a235[0] = 0 +a236[0] = 0 +a237[0] = 0 +a238[0] = 0 +a239[0] = 0 +a240[0] = 0 +a241[0] = 0 +a242[0] = 0 +a243[0] = 0 +a244[0] = 0 +a245[0] = 0 +a246[0] = 0 +a247[0] = 0 +a248[0] = 0 +a249[0] = 0 +a250[0] = 0 +a251[0] = 0 +a252[0] = 0 +a253[0] = 0 +a254[0] = 0 +a255[0] = 0 +a256[0] = 0 + +a1(a253[], len) +printarray(a253[], len) +a3(a253[], len) +printarray(a253[], len) +a5(a253[], len) +printarray(a253[], len) +a7(a253[], len) +printarray(a253[], len) + +a1(a254[], len) +printarray(a254[], len) +a3(a254[], len) +printarray(a254[], len) +a5(a254[], len) +printarray(a254[], len) +a7(a254[], len) +printarray(a254[], len) + +a1(a255[], len) +printarray(a255[], len) +a3(a255[], len) +printarray(a255[], len) +a5(a255[], len) +printarray(a255[], len) +a7(a255[], len) +printarray(a255[], len) + +a1(a256[], len) +printarray(a256[], len) +a3(a256[], len) +printarray(a256[], len) +a5(a256[], len) +printarray(a256[], len) +a7(a256[], len) +printarray(a256[], len) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/scale.txt b/contrib/bc/tests/fuzzing/bc_inputs2/scale.txt new file mode 100644 index 000000000000..e8bee791bce7 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/scale.txt @@ -0,0 +1,57 @@ +scale(0) +scale(1) +scale(12) +scale(123) +scale(1234) +scale(12345) +scale(123456) +scale(1234567) +scale(12345678) +scale(123456789) +scale(1234567890) +scale(1.0) +scale(12.0) +scale(123.0) +scale(1234.0) +scale(12345.0) +scale(123456.0) +scale(1234567.0) +scale(12345678.0) +scale(123456789.0) +scale(1234567890.0) +scale(.1) +scale(.12) +scale(.123) +scale(.1234) +scale(.12345) +scale(.123456) +scale(.1234567) +scale(.12345678) +scale(.123456789) +scale(.1234567890) +scale(.01) +scale(.012) +scale(.0123) +scale(.01234) +scale(.012345) +scale(.0123456) +scale(.01234567) +scale(.012345678) +scale(.0123456789) +scale(.01234567890) +scale(.0000000001) +scale(.00000000012) +scale(.000000000123) +scale(.0000000001234) +scale(.00000000012345) +scale(.000000000123456) +scale(.0000000001234567) +scale(.00000000012345678) +scale(.000000000123456789) +scale(.0000000001234567890) +scale(289.29837) +scale(2893.00000) +scale(289.0) +scale(1802973.0000000238) +scale(.000000000000000093182394080000000000) +scale(0.00000000000000000000) diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt b/contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt new file mode 100644 index 000000000000..bd04562a8df3 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/scientific.txt @@ -0,0 +1,51 @@ +0e0 +0e1 +0e5 +0e-2 +0e-100 +1e0 +-1e1 +1e9 +-1e21 +1e-1 +-1e-2 +1e-5 +4.92837e5 +-3.28971028e20 +6.2e3 +-8.289371e2 +5.9817280937e8 +-3.28977e-1 +8.8927891e-20 +-7.98239e-4 +4.4892e-4 +-18937e0 +198273e10 +-18927e-4 +28937e-5 +-891072e-7 +.28972e0 +-.891273e-1 +.8928397e1 +-.0002983172e5 +.00022e3 +-.00022e4 +.0000328937e8 +obase=0 +0 +1 +10 +-289 +2894 +-89434 +894370 +-1239839 +28931708 +-8052098.8029731809 +.1 +-.01 +.001 +-.00038 +.0000483 +-.0002894378190 +.2893712083 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/shift.txt b/contrib/bc/tests/fuzzing/bc_inputs2/shift.txt new file mode 100644 index 000000000000..0b4d07b5bfd0 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/shift.txt @@ -0,0 +1,281 @@ +0 << 0 +1 << 0 +2 << 0 +0.0023896 << 0 +1.298346 << 0 +2.00000000 << 0 +0.0023896 << 3 +1.298346 << 4 +2.00000000 << 5 +x = 89136.892348976 +x <<= 7 +x +x = 1892634051829351283289298 +x <<= 24 +x +0 >> 0 +1 >> 0 +2 >> 0 +0.0023896 >> 0 +1.298346 >> 0 +2.00000000 >> 0 +0.0023896 >> 3 +1.298346 >> 4 +2.00000000 >> 5 +x = 89136.892348976 +x >>= 7 +x +x = 1892634051829351283289298 +x >>= 24 +x +-1 << 0 +-2 << 0 +-0.0023896 << 0 +-1.298346 << 0 +-2.00000000 << 0 +-0.0023896 << 3 +-1.298346 << 4 +-2.00000000 << 5 +x = -89136.892348976 +x <<= 7 +x +x = -1892634051829351283289298 +x <<= 24 +x +-1 >> 0 +-2 >> 0 +-0.0023896 >> 0 +-1.298346 >> 0 +-2.00000000 >> 0 +-0.0023896 >> 3 +-1.298346 >> 4 +-2.00000000 >> 5 +x = -89136.892348976 +x >>= 7 +x +-x +x = -1892634051829351283289298 +x >>= 24 +x +-x +(0 >> 12) / 2 +10000000000 >> 0 +10000000000 >> 1 +10000000000 >> 2 +10000000000 >> 3 +10000000000 >> 4 +10000000000 >> 5 +10000000000 >> 6 +10000000000 >> 7 +10000000000 >> 8 +10000000000 >> 9 +10000000000 >> 10 +10000000000 >> 11 +10000000000 >> 12 +10000000000 >> 13 +10000000000 >> 14 +10000000000 >> 15 +10000000000 >> 16 +10000000000 >> 17 +10000000000 >> 18 +10000000000 >> 19 +10000000000.1 >> 0 +10000000000.1 >> 1 +10000000000.1 >> 2 +10000000000.1 >> 3 +10000000000.1 >> 4 +10000000000.1 >> 5 +10000000000.1 >> 6 +10000000000.1 >> 7 +10000000000.1 >> 8 +10000000000.1 >> 9 +10000000000.1 >> 10 +10000000000.1 >> 11 +10000000000.1 >> 12 +10000000000.1 >> 13 +10000000000.1 >> 14 +10000000000.1 >> 15 +10000000000.1 >> 16 +10000000000.1 >> 17 +10000000000.1 >> 18 +10000000000.1 >> 19 +10000000000.01 >> 0 +10000000000.01 >> 1 +10000000000.01 >> 2 +10000000000.01 >> 3 +10000000000.01 >> 4 +10000000000.01 >> 5 +10000000000.01 >> 6 +10000000000.01 >> 7 +10000000000.01 >> 8 +10000000000.01 >> 9 +10000000000.01 >> 10 +10000000000.01 >> 11 +10000000000.01 >> 12 +10000000000.01 >> 13 +10000000000.01 >> 14 +10000000000.01 >> 15 +10000000000.01 >> 16 +10000000000.01 >> 17 +10000000000.01 >> 18 +10000000000.01 >> 19 +10000000000.001 >> 0 +10000000000.001 >> 1 +10000000000.001 >> 2 +10000000000.001 >> 3 +10000000000.001 >> 4 +10000000000.001 >> 5 +10000000000.001 >> 6 +10000000000.001 >> 7 +10000000000.001 >> 8 +10000000000.001 >> 9 +10000000000.001 >> 10 +10000000000.001 >> 11 +10000000000.001 >> 12 +10000000000.001 >> 13 +10000000000.001 >> 14 +10000000000.001 >> 15 +10000000000.001 >> 16 +10000000000.001 >> 17 +10000000000.001 >> 18 +10000000000.001 >> 19 +10000000000.0001 >> 0 +10000000000.0001 >> 1 +10000000000.0001 >> 2 +10000000000.0001 >> 3 +10000000000.0001 >> 4 +10000000000.0001 >> 5 +10000000000.0001 >> 6 +10000000000.0001 >> 7 +10000000000.0001 >> 8 +10000000000.0001 >> 9 +10000000000.0001 >> 10 +10000000000.0001 >> 11 +10000000000.0001 >> 12 +10000000000.0001 >> 13 +10000000000.0001 >> 14 +10000000000.0001 >> 15 +10000000000.0001 >> 16 +10000000000.0001 >> 17 +10000000000.0001 >> 18 +10000000000.0001 >> 19 +10000000000.00001 >> 0 +10000000000.00001 >> 1 +10000000000.00001 >> 2 +10000000000.00001 >> 3 +10000000000.00001 >> 4 +10000000000.00001 >> 5 +10000000000.00001 >> 6 +10000000000.00001 >> 7 +10000000000.00001 >> 8 +10000000000.00001 >> 9 +10000000000.00001 >> 10 +10000000000.00001 >> 11 +10000000000.00001 >> 12 +10000000000.00001 >> 13 +10000000000.00001 >> 14 +10000000000.00001 >> 15 +10000000000.00001 >> 16 +10000000000.00001 >> 17 +10000000000.00001 >> 18 +10000000000.00001 >> 19 +10000000000.000001 >> 0 +10000000000.000001 >> 1 +10000000000.000001 >> 2 +10000000000.000001 >> 3 +10000000000.000001 >> 4 +10000000000.000001 >> 5 +10000000000.000001 >> 6 +10000000000.000001 >> 7 +10000000000.000001 >> 8 +10000000000.000001 >> 9 +10000000000.000001 >> 10 +10000000000.000001 >> 11 +10000000000.000001 >> 12 +10000000000.000001 >> 13 +10000000000.000001 >> 14 +10000000000.000001 >> 15 +10000000000.000001 >> 16 +10000000000.000001 >> 17 +10000000000.000001 >> 18 +10000000000.000001 >> 19 +10000000000.0000001 >> 0 +10000000000.0000001 >> 1 +10000000000.0000001 >> 2 +10000000000.0000001 >> 3 +10000000000.0000001 >> 4 +10000000000.0000001 >> 5 +10000000000.0000001 >> 6 +10000000000.0000001 >> 7 +10000000000.0000001 >> 8 +10000000000.0000001 >> 9 +10000000000.0000001 >> 10 +10000000000.0000001 >> 11 +10000000000.0000001 >> 12 +10000000000.0000001 >> 13 +10000000000.0000001 >> 14 +10000000000.0000001 >> 15 +10000000000.0000001 >> 16 +10000000000.0000001 >> 17 +10000000000.0000001 >> 18 +10000000000.0000001 >> 19 +10000000000.00000001 >> 0 +10000000000.00000001 >> 1 +10000000000.00000001 >> 2 +10000000000.00000001 >> 3 +10000000000.00000001 >> 4 +10000000000.00000001 >> 5 +10000000000.00000001 >> 6 +10000000000.00000001 >> 7 +10000000000.00000001 >> 8 +10000000000.00000001 >> 9 +10000000000.00000001 >> 10 +10000000000.00000001 >> 11 +10000000000.00000001 >> 12 +10000000000.00000001 >> 13 +10000000000.00000001 >> 14 +10000000000.00000001 >> 15 +10000000000.00000001 >> 16 +10000000000.00000001 >> 17 +10000000000.00000001 >> 18 +10000000000.00000001 >> 19 +10000000000.000000001 >> 0 +10000000000.000000001 >> 1 +10000000000.000000001 >> 2 +10000000000.000000001 >> 3 +10000000000.000000001 >> 4 +10000000000.000000001 >> 5 +10000000000.000000001 >> 6 +10000000000.000000001 >> 7 +10000000000.000000001 >> 8 +10000000000.000000001 >> 9 +10000000000.000000001 >> 10 +10000000000.000000001 >> 11 +10000000000.000000001 >> 12 +10000000000.000000001 >> 13 +10000000000.000000001 >> 14 +10000000000.000000001 >> 15 +10000000000.000000001 >> 16 +10000000000.000000001 >> 17 +10000000000.000000001 >> 18 +10000000000.000000001 >> 19 +10000000000.0000000001 >> 0 +10000000000.0000000001 >> 1 +10000000000.0000000001 >> 2 +10000000000.0000000001 >> 3 +10000000000.0000000001 >> 4 +10000000000.0000000001 >> 5 +10000000000.0000000001 >> 6 +10000000000.0000000001 >> 7 +10000000000.0000000001 >> 8 +10000000000.0000000001 >> 9 +10000000000.0000000001 >> 10 +10000000000.0000000001 >> 11 +10000000000.0000000001 >> 12 +10000000000.0000000001 >> 13 +10000000000.0000000001 >> 14 +10000000000.0000000001 >> 15 +10000000000.0000000001 >> 16 +10000000000.0000000001 >> 17 +10000000000.0000000001 >> 18 +10000000000.0000000001 >> 19 diff --git a/contrib/bc/tests/fuzzing/bc_inputs2/sine.txt b/contrib/bc/tests/fuzzing/bc_inputs2/sine.txt new file mode 100644 index 000000000000..d3a547bcd796 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs2/sine.txt @@ -0,0 +1,207 @@ +scale = 25 +p = 4 * a(1) +scale = 20 +s(0) +s(0.5) +s(1) +s(2) +s(3) +s(-0.5) +s(-1) +s(-2) +s(-3) +s(p / 7) +s(-p / 7) +s(p / 4) +s(-p / 4) +s(p / 3) +s(-p / 3) +s(p / 2) +s(-p / 2) +s(3 * p / 4) +s(3 * -p / 4) +s(p) +s(-p) +s(3 * p / 2) +s(3 * -p / 2) +s(7 * p / 4) +s(7 * -p / 4) +s(13 * p / 4) +s(13 * -p / 4) +s(2 * p) +s(2 * -p) +s(131231) +s(-131231) +s(69.1967507777) +s(10828) +s(-16248506.847013148) +s(2050281000) +s(8224939) +s(11334231.1154662464) +s(-4109411249.2986954846) +s(-2395915402.13984) +s(-2795874313) +s(-2262647256) +s(3323158182.1239222084) +s(99901384) +s(-4202726050.2780080957) +s(2870000621.3228830588) +s(-4230239450.981045150) +s(-1517506941.2678857223) +s(4004582176) +s(-4193724543.1108508063) +s(-3432511261) +s(1804484812) +s(3229084127) +s(-3565317246.583937244) +s(3503281621) +s(-3469146313.1766891244) +s(-2257308049.307721068) +s(-3978441809) +s(3431564304.3752537) +s(1249644440.2464914559) +s(2395558891.1188487974) +s(-2607820706.4079280116) +s(1208310007) +s(-3758597557.863203175) +s(1186920672) +s(-3988103872) +s(-4280635328.4194857577) +s(1051748072) +s(-1884006279) +s(-1046568719.2698663389) +s(2482991410) +s(-2106101268.1154045959) +s(3530359346.77217900) +s(-3373362543) +s(2601598062) +s(2987020862) +s(-12033356.2057140648) +s(-3721760707) +s(2842387705.4145759704) +s(3515832681.1808393297) +s(-3658522034.16149) +s(3963658030.2860423992) +s(2977802215.597946655) +s(-4271392570.4091498761) +s(2378692585) +s(-3545193743.629374782) +s(-1762458738) +s(-1174277828.4264040126) +s(-1724994857) +s(2802750230.1783499408) +s(-3068133550) +s(3324811474.621822235) +s(2873024984) +s(-3509056632.3888206298) +s(1772903162.647192879) +s(2836543102) +s(4117858580.186) +s(2988632386.4063754522) +s(-4256784971.1770067447) +s(2280820447) +s(-2865200306) +s(-3329592486) +s(519126268) +s(-2452430452) +s(-2693220186.62104082) +s(-3796811992.14485798) +s(3619792326) +s(2697791049.3038381550) +s(3751267834.2808166557) +s(-3761719074) +s(-3824087631) +s(2119301150) +s(1398148974) +s(-3386564819.1351816969) +s(-3171483098) +s(3688944941.3273318162) +s(3060521119) +s(-3527110404) +s(3699631193) +s(3872838898) +s(3880350192) +s(-4109411249.2986954846) +s(-2395915402.13984) +s(-2795874313) +s(-2262647256) +s(3323158182.1239222084) +s(99901384) +s(-4202726050.2780080957) +s(2870000621.3228830588) +s(-4230239450.981045150) +s(-1517506941.2678857223) +s(4004582176) +s(-4193724543.1108508063) +s(-3432511261) +s(1804484812) +s(3229084127) +s(-3565317246.583937244) +s(3503281621) +s(-3469146313.1766891244) +s(-2257308049.307721068) +s(-3978441809) +s(3431564304.3752537) +s(1249644440.2464914559) +s(2395558891.1188487974) +s(-2607820706.4079280116) +s(1208310007) +s(-3758597557.863203175) +s(1186920672) +s(-3988103872) +s(-4280635328.4194857577) +s(1051748072) +s(-1884006279) +s(-1046568719.2698663389) +s(2482991410) +s(-2106101268.1154045959) +s(3530359346.77217900) +s(-3373362543) +s(2601598062) +s(2576349783.2446436039) +s(2987020862) +s(-12033356.2057140648) +s(-3721760707) +s(2842387705.4145759704) +s(3515832681.1808393297) +s(-3658522034.16149) +s(3963658030.2860423992) +s(2977802215.597946655) +s(-4271392570.4091498761) +s(2378692585) +s(-3545193743.629374782) +s(-1762458738) +s(-1174277828.4264040126) +s(-1724994857) +s(2802750230.1783499408) +s(-3068133550) +s(3324811474.621822235) +s(2873024984) +s(-3509056632.3888206298) +s(1772903162.647192879) +s(2836543102) +s(4117858580.186) +s(2988632386.4063754522) +s(-4256784971.1770067447) +s(2280820447) +s(-2865200306) +s(-3329592486) +s(519126268) +s(-2452430452) +s(-2693220186.62104082) +s(-3796811992.14485798) +s(3619792326) +s(2697791049.3038381550) +s(3751267834.2808166557) +s(-3761719074) +s(-3824087631) +s(2119301150) +s(1398148974) +s(-3386564819.1351816969) +s(-3171483098) +s(3688944941.3273318162) +s(3060521119) +s(-3527110404) +s(3699631193) +s(3872838898) +s(3880350192) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/01.txt b/contrib/bc/tests/fuzzing/bc_inputs3/01.txt new file mode 100644 index 000000000000..c016263a9381 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/01.txt @@ -0,0 +1,339 @@ +a(s001020001l[ba]) +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +u +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +u +a +s +c = l[ ca] +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +a +a +s +c = l[ ca] +a +s +c = l[ ca] +a(s001020001l[ ba]) +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +u +a +s +c = l[ ca] +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a*e +cs +c + +a +s(scal[ ba]) +scal[ ca] +a +a +s +c = l[ ca] +a +a +sa +e +css +c = c[ ca] +a +a +sa +e +cs +a +a +sa +e +cs +c + +a(s001020001l[ ba]) + cs +c = l[ ca] +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +a +a +s +c = l[ ca] +a +a +sa +e +css +c = l[ ca] +a +a +sa +e +cs +a +b +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a +e +cs + +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +u +a +s +c = l[ ca] +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +scal[ ca] +a +a +s +c = l[ ca] +a +a +sa +e +css +c = l[ ca] +a +a +sa +e +cs +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +sc0 +c = l[ ca] +a +a +sa +e +cs +c + +a(s001020001l[ ba]) +scal[ ca] +a +a +e +cs +c + +a +s(scal[ ba]) +s(1) +sd= 20 +a(0) +a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +s0000^aaaaaaaaaaaaaaa20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=a00-=se-=as-=se-=axse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscales=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +sd= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scale ==se-=a(1) +scale = 20 +a(0) +a==se-=as+=ase-=se8=as-=se-=a(1) +s ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ae-=a(1) +sc= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +sd= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase = 20 +a(0) +a=i-=se-=ase-=se-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=a0=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as*=e-=as=aaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaa20 +a(0) +a=i-=se-=ase-=se-=as0-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=as0-=se-=as-=se-=axse!=e-=ase-=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=a0-=a0=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=as0-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==ss0-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=as-=ase-=se-=se0=ase-=se-=as-=e-=as=a000=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=a0=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=a0-=e-=as=aaaaaaaaaaaaaaaaaaaaaaa^aaaaaaaaaaaaaaa20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=axse!=e-=ase-=i-=se-=as0-=se-=se-=ase-=se-=as-=e-=as=as0-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=as0-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=as0-=as-=as0-=se-=as-=as0 +a(0) +a=i-=se-=as0-=se-=as0-=i-=s-=se-=xse!=e-=as=as0-=se-=as-=ase-=se-=as-=se-=a(1) +scale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=as0-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=as0-=se-=se-=as0-=a0a^aaaaaaaaaaaaaaa20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=axse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=a0-=e-=as=ase-=se-=as-=as=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscales=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +sd= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +de ==se-=a(1) +scale = 20 +a(0) +a==se-=as-=ase-=se0=as-=se-=a(1) +s ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=as-=ase-=se-=se0=ase-=se-=as-=e-=as=ae-=a(1) +sc= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=se-=xse!=e-=ase-=i-=se-=ase-=se-=se-=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +sd= 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=e-=as=ase = 20 +a(0) +a0i-=se-=ase-=se-=ase-=s-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) +scscale ==se-=a(1) +scale = 20 +a(0) +a=i-=se-=ase-=se-=ase-=i-=s-=se-=xse!=c-=a0=as-se-=se-=se0=ase-=se-=as-=e-=as=ase-=se-=as-=ase-=se-=as-=se-=a(1) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/02.txt b/contrib/bc/tests/fuzzing/bc_inputs3/02.txt new file mode 100644 index 000000000000..8cf0f3e6fec1 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/02.txt @@ -0,0 +1 @@ +obase^= 20-f-b-4^-f-4-4^-f-4^-d diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/03.txt b/contrib/bc/tests/fuzzing/bc_inputs3/03.txt new file mode 100644 index 000000000000..d0fc50564b6d --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/03.txt @@ -0,0 +1,2 @@ +for (i = 0; ; ) +for (i = 0; ;(ssqrt()-p(srt(0-s(t(0-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(sq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(t()-p(sstp(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-v(qrt(ssqrt()-p(ssqrt()-s(ssqrt()-p(ssssq(ssqrt()-p(ssq(ssqrt()-p(t()-sst(prt()-s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-ssqrt()-t(ss(s()-p(srt()-s(ssqrt()-p(s(ssqrtt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(t()-p(sstp(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(osqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sstfor (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(sssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-ssqrt(qrt()-p(s()-p(srt(s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt()-ssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s-t()-s(ssurt()-p(sstss(ssqrt()-p(qr (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(osqrt()-p(sstsq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sstfor (itt()-p(q(s(ssqrt()-t(ss(ssqrt()-p(srt()-s(ssqrt()-p(sstss(sssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-ssqrt(qrt()-p(s()-p(srt(s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt()-ssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s-p(ssqrt()-sst()-p(qrt()-p(s(st()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrt()-p(s()-p(srt()-s(ssqrt()-p(sstss(ssqrt()-p(ssssq(ssqrt()-p(ssqrt()-sst()-p(qrtrrrrr()-p(s(ssqrt()-p(ssqrt()-sst()-p(ssqrt(qrt(ssqrt()-p(ssqrt()-s(ssqrt()-p(ssssq(ssqrt()-p(ssq(ssqrt()-p(ssqrt()-sst()-prt()-s(ssqrt()-p(q(ssqrt()-p(ssqrt()-sst()-ssqrt()-t(ss(s()-p(srt()-s(ssqrt()-p(s(ssqrtt()-p()))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000#000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/04.txt b/contrib/bc/tests/fuzzing/bc_inputs3/04.txt new file mode 100644 index 000000000000..c0965de53faf --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/04.txt @@ -0,0 +1 @@ +"000000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/05.txt b/contrib/bc/tests/fuzzing/bc_inputs3/05.txt new file mode 100644 index 000000000000..99148974ea07 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/05.txt @@ -0,0 +1 @@ +/*00000000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/06.txt b/contrib/bc/tests/fuzzing/bc_inputs3/06.txt new file mode 100644 index 000000000000..29fe6be37021 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/06.txt @@ -0,0 +1 @@ +while (i == 0) { diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/07.txt b/contrib/bc/tests/fuzzing/bc_inputs3/07.txt new file mode 100644 index 000000000000..e899d8547868 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/07.txt @@ -0,0 +1,8 @@ +for(q=F;i<=020; ++i) #00 +{print "0" +if(6)if(6){3 +} +{pr0n} +""} +{pr0n} +{print "" "" diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/08.txt b/contrib/bc/tests/fuzzing/bc_inputs3/08.txt new file mode 100644 index 000000000000..8c5afd789bfa --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/08.txt @@ -0,0 +1,3 @@ +define i(x){ +c0 +if(6)} diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/09.txt b/contrib/bc/tests/fuzzing/bc_inputs3/09.txt new file mode 100644 index 000000000000..f7a347557d83 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/09.txt @@ -0,0 +1,11 @@ +e +-1\ +#00000 +{print"0" +if(1)if(1)#0 +} +if(0)if(0){3 +} +else 4\ +#00000000000000000000000000 +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/10.txt b/contrib/bc/tests/fuzzing/bc_inputs3/10.txt new file mode 100644 index 000000000000..23fb8689f598 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/10.txt @@ -0,0 +1 @@ +d000$++ diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/11.txt b/contrib/bc/tests/fuzzing/bc_inputs3/11.txt new file mode 100644 index 000000000000..19e7e87b2d65 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/11.txt @@ -0,0 +1,99 @@ +#0000000000000000 + +define printarray(a[],len){ + +auto i + +for(i=0; i < n; ++i) { + a[i] + } +} + +define a2(a[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a[i] = a[i] * a[i] + } + + printarray(len, n) +} + +define a4(a00[], l) { + + auto i + + for (i = 0; i < l; ++i) { + a[i] = a00[i] * a[i] + } + + printarray(a00[], l) +} + +define a6(*a00[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a00[i] = a00[i] * a00[i] + } + + printarray(a00[], len) +} + +define a1(*a[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a[i] = i + } + + a2(a[], len) + + printarray(a[], len) +} + +define a0(*a00[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a00[i] = i + } + + a0(a00[], len) + + printarray(a00[], len) +} + +define a5(*a00[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a00[i] = i + } + + a0(a00[], len) + + printarray(a, len) +} + +define a7(*a00[], len) { + + auto i + + for (i = 0; i < len; ++i) { + a00[i] = i + } + + a0(a00[], len) + + printarray(a00[], len) +} + +len = 16 + +a1(a[], len) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/12.txt b/contrib/bc/tests/fuzzing/bc_inputs3/12.txt new file mode 100644 index 000000000000..143bb71deeda --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/12.txt @@ -0,0 +1,2 @@ +for (v ;!j -90-90; ++i) +a= ibase ++;0 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/13.txt b/contrib/bc/tests/fuzzing/bc_inputs3/13.txt new file mode 100644 index 000000000000..5628ba703cde --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/13.txt @@ -0,0 +1,56 @@ +#0 + +define z(a[]) {for (i = 0; i < l; ++i) { + a[i] + } +} + +define x(a[]) { + + #00000000000000000000000000000000000 + auto a + + for (a = 0; a < l; ++a) { + a[a] = -a + } + + z(a[]) +} + +define g(x[], y[]) { + return x[0] - y[0] +} + +define h(u000 x[]) { + return g(x[], y[]) +} + +define m(*x[], *y[]) { + return x[0] / y[0] +} + +define n(*y[], *x[]) { + return m(x[], y[]) +} + +for (i = 0; i < 101; ++i) { + a[i] = i +} + +a[104] = 200 + +l = length(a[]) + +for (i = 0; i <= l; ++i) { + a[i] +} + +z(a[]) +x(a[]) +z(a[]) +l + +x[0] = 5 +y[0] = 4 + +h(x[], y[]) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/14.txt b/contrib/bc/tests/fuzzing/bc_inputs3/14.txt new file mode 100644 index 000000000000..2487d82acd48 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/14.txt @@ -0,0 +1 @@ +a(int32(O100000000)) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/15.txt b/contrib/bc/tests/fuzzing/bc_inputs3/15.txt new file mode 100644 index 000000000000..cf1f81dfb005 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/15.txt @@ -0,0 +1,3 @@ +for (i = 0; int32(29834); ++i) { + i +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/16.txt b/contrib/bc/tests/fuzzing/bc_inputs3/16.txt new file mode 100644 index 000000000000..977569bda330 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/16.txt @@ -0,0 +1 @@ +"0
\ No newline at end of file diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/17.txt b/contrib/bc/tests/fuzzing/bc_inputs3/17.txt new file mode 100644 index 000000000000..f158be7e5f48 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/17.txt @@ -0,0 +1,11 @@ +print "000000000000000000\n" + +s = s0 + +m = 0 + +for (i = 0; i < 100; ++i) { + a[i] =d() + s= a[i] + b[i] = irand(u0) +} diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/18.txt b/contrib/bc/tests/fuzzing/bc_inputs3/18.txt new file mode 100644 index 000000000000..9f338c1f5a65 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/18.txt @@ -0,0 +1,3 @@ +while(0){ + +define diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/19.txt b/contrib/bc/tests/fuzzing/bc_inputs3/19.txt new file mode 100644 index 000000000000..1edb8c62d49a --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/19.txt @@ -0,0 +1,5 @@ +define i(x){ + +i(10) +ibase +o(10)`0000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/20.txt b/contrib/bc/tests/fuzzing/bc_inputs3/20.txt new file mode 100644 index 000000000000..465146d458fd --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/20.txt @@ -0,0 +1,51 @@ +define w() { auto z; return 1; } +define x() { +"0" +return (1) +} +define y() { +"0" + return (2) +} +define z() { + "0" + return (3) +} +define v() { return } + +v() + +w() + +if (x() == y()) { 0 } +1 +if (x() <= y()) { 2 } +if (y() >= x()) { 3 } +if (x() != y()) { 4 } +if (x() < y()) { 5 } +if (y() > x()) { 6 } + +if (x() == z()) { 100} +10 +if (x() <= z()) { 10 } +if (z() >= x()) { 10 } +if (x() != z()) { 10 } +if (x() < z()) { 10 } +if (z() > x()) { 10 } + +x = -10 +while (x <= 0) { + x + if (x == -5) break; + x += 1 +} + +define u() { + auto a[]; + return a[H] +} + +u() + +if (x == -4) x +000000000000000000000000ÿ diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/21.txt b/contrib/bc/tests/fuzzing/bc_inputs3/21.txt new file mode 100644 index 000000000000..531705b29237 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/21.txt @@ -0,0 +1,10 @@ +define i(x) { + ibase=x + s0=x + return 74; b=100.000000000000;e +} + +i(11) +ibase +o0 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/22.txt b/contrib/bc/tests/fuzzing/bc_inputs3/22.txt new file mode 100644 index 000000000000..f7a91f0b7774 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/22.txt @@ -0,0 +1,2 @@ +#000000000000000 + for(i = 0; i < M; ++i) l000000000000= length(a00000000iii= l[]0 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/23.txt b/contrib/bc/tests/fuzzing/bc_inputs3/23.txt Binary files differnew file mode 100644 index 000000000000..15045f277e00 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/23.txt diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/24.txt b/contrib/bc/tests/fuzzing/bc_inputs3/24.txt new file mode 100644 index 000000000000..25f98c159d4f --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/24.txt @@ -0,0 +1,4 @@ +perm(10,2) +comb(10,2) +perm(6,2) +b(6,++i[] diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt b/contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt new file mode 100644 index 000000000000..07cdee66492c --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/sqrt.txt @@ -0,0 +1,14 @@ +scale = 20 +sqrt(0) +sqrt(2) +sqrt(4) +sqrt(9) +sqrt(16) +sqrt(25) +sqrt(121) +sqrt(48765) +sqrt(9287356207356) +sqrt(0.189274385967238956872354) +sqrt(12389467137496823.134567829387456283946) +sqrt(.0000000000000000000000000000123) +sqrt(1) diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/strings.txt b/contrib/bc/tests/fuzzing/bc_inputs3/strings.txt new file mode 100644 index 000000000000..1cb7d6a61c54 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/strings.txt @@ -0,0 +1,12 @@ +"string" +"another string" +"yet +another +string" +"noescapes\n" +"newline +" +print "string" +print "newline\n" + +print "\\\e\n" diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt b/contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt new file mode 100644 index 000000000000..e3ea1ced9ec5 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/subtract.txt @@ -0,0 +1,153 @@ +0 - 0 +0 - 1 +1 - 0 +1 - 1 +5 - 2 +2 - 9 +321974 - 12845976238457 +2874519803456710938465 - 384723854 +10000000000000000000000000000000000000000 - 999999999999999999999999999999999999999 +10000000000000000000000000000000000000000 - 9999999999999999999999999999999999999999 +10000000000000000000000000000000000000000 - 999999999999999999999999999999999999999.99999999999999999999999999999999999 +10000000000000000000000000000000000000000 - 9999999999999999999999999999999999999999.9999999999999999999999999999999999 +10000000000000000000000000000000000000000 - 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +10000000000000000000000000000000000000001 - 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001 +10000000000000000000000000000000000000000.0000000001 - 0.0000000000000000000000000000000000000000000000000000000000000000000000000001 +-2 - 6 +-23784692345 - 182934721309467230894628735496027345 +-224352354962873059862 - -1245723576829456278354960278345 +-3468273598 - -12354243 +-0.92345768293 - -2354768923 +-712384634.123476823 - -24768293376 +-1879234638 - -0.917234869234 +-0.9172438692134 - -0.971284967124 +-0.1283475123465 - -0.937462346 +-124765829346.2837468293562 - -0.923467829346 +-12476829385769 - -1928476259034.8378629356 +-0.38476284395876345 - -94875394587623.2357869324857 +-4674596708467.34754789403674343567 - -48672394852354698.237548629345 +979519669 - 3018100865 +929002449 - 3280677283 +0 - -525898 +3- - -3 +18297034019823741908237410928374.81920734712098347109281029873 - 182907.12809 +182039471029834 - 282039471029834 +282039471029834 - 182039471029834 +182039471029834.2801722893 - 282039471029834 +282039471029834.2801722893 - 182039471029834 +182039471029834.2801722893 - 282039471029834.2838 +282039471029834.2801722893 - 182039471029834.2838 +182039471029834 - 282039471029834.2801722893 +282039471029834 - 182039471029834.2801722893 +182039471029834.8297282893 - 282039471029834.2801722893 +282039471029834.8297282893 - 182039471029834.2801722893 +471029834 - 282039471029834 +471029834 - 182039471029834 +471029834.2801722893 - 282039471029834 +471029834.2801722893 - 182039471029834 +471029834.2801722893 - 282039471029834.2838 +471029834.2801722893 - 182039471029834.2838 +471029834 - 282039471029834.2801722893 +471029834 - 182039471029834.2801722893 +471029834.8297282893 - 282039471029834.2801722893 +471029834.8297282893 - 182039471029834.2801722893 +182039471029834 - 471029834 +282039471029834 - 471029834 +182039471029834.2801722893 - 471029834 +282039471029834.2801722893 - 471029834 +182039471029834.2801722893 - 471029834.2838 +282039471029834.2801722893 - 471029834.2838 +182039471029834 - 471029834.2801722893 +282039471029834 - 471029834.2801722893 +182039471029834.8297282893 - 471029834.2801722893 +282039471029834.8297282893 - 471029834.2801722893 +-182039471029834 - 282039471029834 +-282039471029834 - 182039471029834 +-182039471029834.2801722893 - 282039471029834 +-282039471029834.2801722893 - 182039471029834 +-182039471029834.2801722893 - 282039471029834.2838 +-282039471029834.2801722893 - 182039471029834.2838 +-182039471029834 - 282039471029834.2801722893 +-282039471029834 - 182039471029834.2801722893 +-182039471029834.8297282893 - 282039471029834.2801722893 +-282039471029834.8297282893 - 182039471029834.2801722893 +-471029834 - 282039471029834 +-471029834 - 182039471029834 +-471029834.2801722893 - 282039471029834 +-471029834.2801722893 - 182039471029834 +-471029834.2801722893 - 282039471029834.2838 +-471029834.2801722893 - 182039471029834.2838 +-471029834 - 282039471029834.2801722893 +-471029834 - 182039471029834.2801722893 +-471029834.8297282893 - 282039471029834.2801722893 +-471029834.8297282893 - 182039471029834.2801722893 +-182039471029834 - 471029834 +-282039471029834 - 471029834 +-182039471029834.2801722893 - 471029834 +-282039471029834.2801722893 - 471029834 +-182039471029834.2801722893 - 471029834.2838 +-282039471029834.2801722893 - 471029834.2838 +-182039471029834 - 471029834.2801722893 +-282039471029834 - 471029834.2801722893 +-182039471029834.8297282893 - 471029834.2801722893 +-282039471029834.8297282893 - 471029834.2801722893 +182039471029834 - -282039471029834 +282039471029834 - -182039471029834 +182039471029834.2801722893 - -282039471029834 +282039471029834.2801722893 - -182039471029834 +182039471029834.2801722893 - -282039471029834.2838 +282039471029834.2801722893 - -182039471029834.2838 +182039471029834 - -282039471029834.2801722893 +282039471029834 - -182039471029834.2801722893 +182039471029834.8297282893 - -282039471029834.2801722893 +282039471029834.8297282893 - -182039471029834.2801722893 +471029834 - -282039471029834 +471029834 - -182039471029834 +471029834.2801722893 - -282039471029834 +471029834.2801722893 - -182039471029834 +471029834.2801722893 - -282039471029834.2838 +471029834.2801722893 - -182039471029834.2838 +471029834 - -282039471029834.2801722893 +471029834 - -182039471029834.2801722893 +471029834.8297282893 - -282039471029834.2801722893 +471029834.8297282893 - -182039471029834.2801722893 +182039471029834 - -471029834 +282039471029834 - -471029834 +182039471029834.2801722893 - -471029834 +282039471029834.2801722893 - -471029834 +182039471029834.2801722893 - -471029834.2838 +282039471029834.2801722893 - -471029834.2838 +182039471029834 - -471029834.2801722893 +282039471029834 - -471029834.2801722893 +182039471029834.8297282893 - -471029834.2801722893 +282039471029834.8297282893 - -471029834.2801722893 +-182039471029834 - -282039471029834 +-282039471029834 - -182039471029834 +-182039471029834.2801722893 - -282039471029834 +-282039471029834.2801722893 - -182039471029834 +-182039471029834.2801722893 - -282039471029834.2838 +-282039471029834.2801722893 - -182039471029834.2838 +-182039471029834 - -282039471029834.2801722893 +-282039471029834 - -182039471029834.2801722893 +-182039471029834.8297282893 - -282039471029834.2801722893 +-282039471029834.8297282893 - -182039471029834.2801722893 +-471029834 - -282039471029834 +-471029834 - -182039471029834 +-471029834.2801722893 - -282039471029834 +-471029834.2801722893 - -182039471029834 +-471029834.2801722893 - -282039471029834.2838 +-471029834.2801722893 - -182039471029834.2838 +-471029834 - -282039471029834.2801722893 +-471029834 - -182039471029834.2801722893 +-471029834.8297282893 - -282039471029834.2801722893 +-471029834.8297282893 - -182039471029834.2801722893 +-182039471029834 - -471029834 +-282039471029834 - -471029834 +-182039471029834.2801722893 - -471029834 +-282039471029834.2801722893 - -471029834 +-182039471029834.2801722893 - -471029834.2838 +-282039471029834.2801722893 - -471029834.2838 +-182039471029834 - -471029834.2801722893 +-282039471029834 - -471029834.2801722893 +-182039471029834.8297282893 - -471029834.2801722893 +-282039471029834.8297282893 - -471029834.2801722893 diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt b/contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt new file mode 100644 index 000000000000..364bb224a2e3 --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/trunc.txt @@ -0,0 +1,15 @@ +0$ +1$ +2$ +0.8249167203486$ +1.28937150237$ +2.0$ +28937.92837605126$ +2890.000000000$ +-1$ +-1.128973$ +-9812387.28910273$ +x = 83.298 +x$ +x = -1893.19 +(x)$ diff --git a/contrib/bc/tests/fuzzing/bc_inputs3/void.txt b/contrib/bc/tests/fuzzing/bc_inputs3/void.txt new file mode 100644 index 000000000000..b85d70c8590a --- /dev/null +++ b/contrib/bc/tests/fuzzing/bc_inputs3/void.txt @@ -0,0 +1,20 @@ +define void stuff(x) { + print "x: ", x, "\n" +} + +define void(x) { + return x +} + +stuff(0) +stuff(1) +stuff(2.2839) +stuff(-9.9289389) + +void(0) +void(1) +void(2.9823) +void(-3.5982) + +void = .198389 +void + 10 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/01.txt b/contrib/bc/tests/fuzzing/dc_inputs/01.txt new file mode 100644 index 000000000000..9622de95a241 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/01.txt @@ -0,0 +1,2 @@ +[[000000000 +00000] diff --git a/contrib/bc/tests/fuzzing/dc_inputs/02.txt b/contrib/bc/tests/fuzzing/dc_inputs/02.txt new file mode 100644 index 000000000000..79565935cf23 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/02.txt @@ -0,0 +1,5 @@ +0 R +2 1 +1 0+pRpp +30.x +[00000000]ip1+pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/03.txt b/contrib/bc/tests/fuzzing/dc_inputs/03.txt new file mode 100644 index 000000000000..ecede2e05629 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/03.txt @@ -0,0 +1,2 @@ +0 lip1-si0l0+200sx_9lq+pR 30.x +[li100L0dp1+s+sX10lM<0]sL0sJlLx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/04.txt b/contrib/bc/tests/fuzzing/dc_inputs/04.txt new file mode 100644 index 000000000000..209f50c16d52 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/04.txt @@ -0,0 +1,9 @@ +zp100000000.000004p1+pR +0 1 1+kpR +1 1+pR +1 0IpR +2 9+iR +037 483+pR +999 999+pR +237467456283846vpR +.0000000ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddsdddddddddddddddddddddddddddddddddddddddddddddddddddddsdddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd/ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddfddddddddddddddddddddddddddddddddddddddddddddddddddddddcdddddddddddd9000000000000000000 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/05.txt b/contrib/bc/tests/fuzzing/dc_inputs/05.txt new file mode 100644 index 000000000000..bf2ca982ed2b --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/05.txt @@ -0,0 +1,3 @@ +04000000000000300sx_9000.00000syzpRlxlq+pR +30.x +[li1000000sxL0LLLL900000.00000sLLL]sL0s0lLx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/06.txt b/contrib/bc/tests/fuzzing/dc_inputs/06.txt new file mode 100644 index 000000000000..eff417eb55b4 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/06.txt @@ -0,0 +1 @@ +00Q;pd60 p d9S06+00I;pd60Q2 0^pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/07.txt b/contrib/bc/tests/fuzzing/dc_inputs/07.txt new file mode 100644 index 000000000000..8a09152faf58 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/07.txt @@ -0,0 +1,3 @@ +1 0 1|dR +1 [li0L]SL10sildR +1 [li0L]sL10|Lx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/08.txt b/contrib/bc/tests/fuzzing/dc_inputs/08.txt new file mode 100644 index 000000000000..156de2f536b6 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/08.txt @@ -0,0 +1 @@ +0 2+p[lip1-si0li!=0^di>0]S098sil0x diff --git a/contrib/bc/tests/fuzzing/dc_inputs/09.txt b/contrib/bc/tests/fuzzing/dc_inputs/09.txt new file mode 100644 index 000000000000..ffc3a08908d4 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/09.txt @@ -0,0 +1,9 @@ +#00000 +0sm[Nx]0s0[]0s0x[]zs0x[]0s0[]zs0c +0s0[Nx]0s0[]zs0x[]zs0x[Nx]0s0[]zs0#000000000 +0s0[Nx]0s_[]zs0x[li]zs^x[l0000000]0sm[]zs0x[liNx]zs0x[li;0lilix] +x[liN]zsWx[liN]zs0x[li;0lilix] +x[liNzs0x#000000000 +*sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zsdc +0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]x]zsxx#000000000 +*s0[Nx]0sm[]0s00[00]zs0x[Nx]0sm[]z0dc diff --git a/contrib/bc/tests/fuzzing/dc_inputs/10.txt b/contrib/bc/tests/fuzzing/dc_inputs/10.txt new file mode 100644 index 000000000000..0fade4bb899f --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/10.txt @@ -0,0 +1,11 @@ +#0000 +0sm[Nx]0sm[]0s0x[li]0s0x[Nfvfff[]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0c +0sm[Nx]0sm[]x[li]zs0x[Nx]0sm[]zs0c +0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0c +0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#000000000 +0sm[Nx]0s0[]zs0x[li]zs0x[0000000000]0sm[]zs0x[liNx]zs0x[li;0l0l0x] +x[liNx]zs0x#000000000 +0sm[Nx]0sm[]zs0x[li]zs0x[000]0sm[]x[li]zs0x[Nx]0sm[]zs0c +0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#0000 +0sm[Nx]0sm[]zs0x[li]zs0x[Nx]0sm[]zs0#000000000 +0sm[Nx]0s_@]zs0x[li]s^x[0000000000]0s0[]zsW[0000]zsxx[000000000] diff --git a/contrib/bc/tests/fuzzing/dc_inputs/11.txt b/contrib/bc/tests/fuzzing/dc_inputs/11.txt new file mode 100644 index 000000000000..73bbc7d88f1c --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/11.txt @@ -0,0 +1,4 @@ +#00000000 +[[00000]aa]sM[lip1-si0li>0eM]s010sil0x +[[0000]00]sM[]s010sil0x +[R]sM[lip=000]s0;0 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/12.txt b/contrib/bc/tests/fuzzing/dc_inputs/12.txt new file mode 100644 index 000000000000..aff25e7381cd --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/12.txt @@ -0,0 +1,2 @@ +1;09R0si[lii000000000000000000000000000000000000000000]li1000 2346dvdddd;ddddddddddddd?-sdddddddddd0+dd0 1+pR +0dvdddd;ddSddddddddddd 0si[lid1+sil0sili10li?-s0]dsxx[00000000]li1000 2000dvddddddddddddddddddddddddd0 0+ddd 1+pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/13.txt b/contrib/bc/tests/fuzzing/dc_inputs/13.txt new file mode 100644 index 000000000000..e6af9463e38c --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/13.txt @@ -0,0 +1,7 @@ +zp10[00000000\00]pppppppppppppppR +_1 _1(pR +_1 _2(pR +2 1{pR +_1 1{pR 990+pR +2000000 300000300000000+pR +2070000000aaaaaaaaaaaaaaxaaaaaaaaaaaaR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/14.txt b/contrib/bc/tests/fuzzing/dc_inputs/14.txt new file mode 100644 index 000000000000..741f3bfd7704 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/14.txt @@ -0,0 +1,7 @@ +0bpR +1bpR +.200000bpR +100000.0000600bpR +_10bpR +_.1000000bpR +_30000.00bpR:
\ No newline at end of file diff --git a/contrib/bc/tests/fuzzing/dc_inputs/15.txt b/contrib/bc/tests/fuzzing/dc_inputs/15.txt new file mode 100644 index 000000000000..828e8204a2aa --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/15.txt @@ -0,0 +1,11 @@ +0bpax1bpR +1bpR +.30b900pR +_10bp/90 +_30_.1/10bp30_.1/90 +_300.1/90/90 +_30_.1/90 +_30000.1/90 +90 +_30000.1/90 +70.000 70u diff --git a/contrib/bc/tests/fuzzing/dc_inputs/16.txt b/contrib/bc/tests/fuzzing/dc_inputs/16.txt new file mode 100644 index 000000000000..b021dd66d7ff --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/16.txt @@ -0,0 +1 @@ +0 0;^dddddRps0R@s016dddRRd^2ddRZ(b-P;;$p;;;;;;9;;;;;;$ppppppppppppp30 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/17.txt b/contrib/bc/tests/fuzzing/dc_inputs/17.txt new file mode 100644 index 000000000000..fb46510fc3e3 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/17.txt @@ -0,0 +1,20 @@ +0 1(pR +1;;;;;pR +1 +0 18d[0000000 +000000000000000000000000000000]sM[liv1-si0li!<0pR +_1 0{pR +_1 _1{pR +_1 f0070000000000.0000000000000_10000000000006.00000000000005~pRpR +_23745860900000.070000000000000 _0.20542357869124050~pRpR +_3000000000000000.0000000700000006002 _7000000000000005000000000.000F000000000000003~pRpR20000000 300000000003.00000000000000030~pRpR +_30000000000000000000000000 +1 0.001.00000000030 +1 0.000000000000000000000000000000000000000000000000000000000000000000002x30000000000000000000000000000000000000$80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<0800000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000.000F000000000000003~pRpR20000000 300000000003.00000000000000030~pRpR +_30000000000000.00000000000 +1 0.070.70000000000 +1 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000$80000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000<080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000S8800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000Z800000000000 +_10pR +=390NpR +_2000 +40000 5000C 2i>0eM]s01@sil0x diff --git a/contrib/bc/tests/fuzzing/dc_inputs/18.txt b/contrib/bc/tests/fuzzing/dc_inputs/18.txt new file mode 100644 index 000000000000..ed2659d097c2 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/18.txt @@ -0,0 +1,3 @@ +1oVVf[li;WORli1S0Zli1;rORli1dH|2li@d-NliO+rK28729@9547628O745/pR +_29307546189299999999999999999999999999999999999995 0.00000000000000000000000000009999999999999999999+99$9999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 0.0000000000000000000000000000000000R0000000000000000000000000000000000000+0000000000000000-0000000000000000000005+pR +99999999999999999999999999999999999999999999999999999999999.999999999999999999999.99999999999999999999999999999999999999999900000000000000000000000R0000000000000000000000000000000000000+0000000000000000-0000000000000000000005+pR999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000C0020P00000000000000000000000000000000000007fli1+7fli1+si;d7dli1+si;0=Rls1d:0li +i100>x]dsxx[0000000]dsxx[p000]l010000000 00000000000pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/19.txt b/contrib/bc/tests/fuzzing/dc_inputs/19.txt new file mode 100644 index 000000000000..df417b4ab6d3 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/19.txt @@ -0,0 +1 @@ +þ0000000000000000000000000000000 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/20.txt b/contrib/bc/tests/fuzzing/dc_inputs/20.txt new file mode 100644 index 000000000000..aa7752a85c67 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/20.txt @@ -0,0 +1,3 @@ +#0000 +I20PPrP PPPP PPs0daP1:0pR + PPP1d:0pRR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/21.txt b/contrib/bc/tests/fuzzing/dc_inputs/21.txt new file mode 100644 index 000000000000..01707d8256b6 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/21.txt @@ -0,0 +1,5 @@ +0bpR +1bpR +.200000bpR +100000.0000600bpR +S09bpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/22.txt b/contrib/bc/tests/fuzzing/dc_inputs/22.txt new file mode 100644 index 000000000000..898184649926 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/22.txt @@ -0,0 +1,36 @@ +[0000000000000]ZpR +[He00 +[0000000\00000000]00 +[0000000\00000000]000 +[0000000\00000000]00 +[0000] +00000] +[28pR] +[27pR] +[26pR] +[25pR] +[24pR] +[23pR] +[22pR] +[21pR] +[20pR] +[19pR] +[18pR] +[17pR] +[16pR] +[15pR] +[14pR] +[13pR] +[12pR] +[11pR] +[10pR] +[9pR] +[8pR] +[7pR] +[6pR] +[5pR] +[4pR] +[3pR] +[2pR] +[1pR] +[xz0<x]dsxx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/23.txt b/contrib/bc/tests/fuzzing/dc_inputs/23.txt new file mode 100644 index 000000000000..1897dfbbb0aa --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/23.txt @@ -0,0 +1,2 @@ +#00000000 +[[0000]00]SM[l0p1-s00l0`000]s010sil0x diff --git a/contrib/bc/tests/fuzzing/dc_inputs/24.txt b/contrib/bc/tests/fuzzing/dc_inputs/24.txt new file mode 100644 index 000000000000..fb9b04f7f5b8 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/24.txt @@ -0,0 +1 @@ + [] 0:xX:0 0:0X:0n/dc.000C00}pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/25.txt b/contrib/bc/tests/fuzzing/dc_inputs/25.txt new file mode 100644 index 000000000000..d48a9b2e83fd --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/25.txt @@ -0,0 +1,6 @@ +#00000000 +0s0[l0d:0l01;0d:0l01;0pRl01+s0l010>x]dsxx0sx0s0 +1 2 +s0[l0d:0l01;0d:0l01;0pRl01+s0l010>x]dsxx0sx0s0 +1 2 +€ diff --git a/contrib/bc/tests/fuzzing/dc_inputs/26.txt b/contrib/bc/tests/fuzzing/dc_inputs/26.txt new file mode 100644 index 000000000000..731d3969ac3b --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/26.txt @@ -0,0 +1,155 @@ +0bpR +1bp0 +.20bpR +100000.0000005bpR +_10bpR +_.1000[l0;0;rpRl01+s0l010>x]dsxx0sx0s0 +1 2+p+p +3+p +4+p +5+p +6+p +7+p +8+p +9+p +10+p +11+p +12+p +13+p +14+p +15+p +16+p +17+p +18+p +19+p +20+p +21+0+p +71+o +70+p +70+p +70+p +70+p +22+p +20+p +20+p +20+p +20+p +20+p +20+p +20+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +40+1+p +40+p +40+p +40+p +40+p +40+p +40+p +40+p +40+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +60+p +60+p +60bpR +1bp0 +.20bpR +100000.0070000bpR +_10bpR +_.1000[l0;0;rpRl01+s0l010>x]dsxx0sx0s0 +1 2+p+p +3+p +4+p +5+p +6+p +7+p +8+p +9+p +10+p +11+p +12+p +13+p +14+p +15+p +16+p +17+p +18+p +19+p +20+p +21+0+p +71+o +70+p +70+p +70+p +70+p +22+p +20+p +20+p +20+p +20+p +20+p +20+p +20+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +30+p +40+1+p +40+p +40+p +40+p +40+p +40+p +40+p +40+p +40+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +50+p +60+p +60+p +60+p +60+p +60+p +60+p +60+p +60 +70+p +70+p +70+p +70+p +70+p +70+p +70+p +80+p +È diff --git a/contrib/bc/tests/fuzzing/dc_inputs/27.txt b/contrib/bc/tests/fuzzing/dc_inputs/27.txt new file mode 100644 index 000000000000..69745b952afc --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/27.txt @@ -0,0 +1,2 @@ +"0000000\ + diff --git a/contrib/bc/tests/fuzzing/dc_inputs/28.txt b/contrib/bc/tests/fuzzing/dc_inputs/28.txt new file mode 100644 index 000000000000..fe81732b3e38 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/28.txt @@ -0,0 +1 @@ +10 4%0:i[000] 1:b 0;0 p 1;b0:b [000] 1:b 0;b p 1;b~b 0;b p 0;b~~~0k diff --git a/contrib/bc/tests/fuzzing/dc_inputs/29.txt b/contrib/bc/tests/fuzzing/dc_inputs/29.txt new file mode 100644 index 000000000000..886eb8ee0a8e --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/29.txt @@ -0,0 +1,13 @@ +10 4%0:b [200] 1:b 0;b 1;b X + 2000 1%p0 +3460:b [200] 1:b 0;b p bp0 +.2 1%pR +6 4%pR +10 4%0:b [200] 1:b 0;b p 1;b X + 20000 1%pR +b 0;b p 0;b2 +1bpb [200] 1:u 0;b p 1;b X + 2 +[000] 0:b [200] 0:b 0;b p S0b p +[s0]XpR + diff --git a/contrib/bc/tests/fuzzing/dc_inputs/30.txt b/contrib/bc/tests/fuzzing/dc_inputs/30.txt new file mode 100644 index 000000000000..e072e71617d8 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/30.txt @@ -0,0 +1 @@ +0;0[]0:b;bs0l0x;0 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/31.txt b/contrib/bc/tests/fuzzing/dc_inputs/31.txt new file mode 100644 index 000000000000..9bada9d07d0e --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/31.txt @@ -0,0 +1 @@ +0;0[]0:b;bS0l0x;0 diff --git a/contrib/bc/tests/fuzzing/dc_inputs/abs.txt b/contrib/bc/tests/fuzzing/dc_inputs/abs.txt new file mode 100644 index 000000000000..9907dfc6679d --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/abs.txt @@ -0,0 +1,7 @@ +0bpR +1bpR +.218933bpR +138963.9873645bpR +_19bpR +_.1298376bpR +_3892173.289375bpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/add.txt b/contrib/bc/tests/fuzzing/dc_inputs/add.txt new file mode 100644 index 000000000000..42da2f1f309c --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/add.txt @@ -0,0 +1,33 @@ +0 0+pR +0 0 0++pR +0 1+pR +0 1 1++pR +1 1+pR +1 0+pR +2 5+pR +237 483+pR +999 999+pR +2374623 324869356734856+pR +2378639084586723980562 23468729367839+pR +37298367203972395108367910823465293084561329084561390845613409516734503870691837451 785621394067928346918023476190834672198467134908618723249671349062187346898241093486139046139084613490817356023871869102746182749061872609129847+pR +1.1 0+pR +0 1.1+pR +457283.731284923576 37842934672834.3874629385672354+pR +1.0 0.1+pR +3746289134067138046 0.138375863945672398456712389456273486293+pR +_1 _1+pR +_4 _15+pR +_1346782 _1287904651762468913476+pR +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999995 0.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005+pR +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR +99999999999999999999999999999999999999999999999999999999999.999999999999999999999999999999999999999999999999999999999899999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR +99999999999999999999999999999999999989999999999999999999999.999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001+pR +_1889985797 2012747315+pR +0 _14338.391079082+pR +_2422297 1.3134942556+pR +_1289374 1289374.2893417 0.238971 28937.28971+++pR +1289374 1289374.2893417 _0.238971 28937.28971+++pR +1289374 1289374.2893417 0.238971 _28937.28971+++pR +1289374 1289374.2893417 _0.238971 _28937.28971+++pR +1289374 _1289374.2893417 _0.238971 _28937.28971+++pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/array.dc b/contrib/bc/tests/fuzzing/dc_inputs/array.dc new file mode 100644 index 000000000000..970f29a68768 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/array.dc @@ -0,0 +1,2 @@ +#! /usr/bin/dc +0si[lid:rli1+sili100>x]dsxx[li;rpRli1-sili100!>x]li1+[li;rpRli1+sili100>x] diff --git a/contrib/bc/tests/fuzzing/dc_inputs/boolean.txt b/contrib/bc/tests/fuzzing/dc_inputs/boolean.txt new file mode 100644 index 000000000000..815100f0d085 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/boolean.txt @@ -0,0 +1,80 @@ +0 1(pR +1 1(pR +2 1(pR +_1 1(pR +_1 0(pR +_1 _1(pR +_1 _2(pR +0 1{pR +1 1{pR +2 1{pR +_1 1{pR +_1 0{pR +_1 _1{pR +_1 _2{pR +0 1)pR +1 1)pR +2 1)pR +_1 1)pR +_1 0)pR +_1 _1)pR +_1 _2)pR +0 1}pR +1 1}pR +2 1}pR +_1 1}pR +_1 0}pR +_1 _1}pR +_1 _2}pR +0 0GpR +0 1GpR +1 0GpR +_1 _1GpR +0 _1GpR +_1 0GpR +1 1GpR +238 2GpR +0NpR +1NpR +_1NpR +2398NpR +_2983.2389NpR +0 0MpR +1 0MpR +0 1MpR +1 1MpR +128973240 0MpR +0 2893712MpR +1982 28937MpR +_2938 0MpR +0 _1023.298037MpR +0.283917 0MpR +2389 _1208.28937MpR +0 289.289372MpR +_298.29387 0MpR +_2983.28973 82937MpR +0 _2938.320837MpR +_2089.2308 0MpR +_0.2893 _2938.28973MpR +0.00000 1892MpR +1289.023 .0000MpR +0 0mpR +1 0mpR +0 1mpR +1 1mpR +128973240 0mpR +0 2893712mpR +1982 28937mpR +_2938 0mpR +0 _1023.298037mpR +0.283917 0mpR +2389 _1208.28937mpR +0 289.289372mpR +_298.29387 0mpR +_2983.28973 82937mpR +0 _2938.320837mpR +_2089.2308 0mpR +_0.2893 _2938.28973mpR +0.00000 1892mpR +1289.023 .0000mpR +0.0000 .00000mpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/decimal.txt b/contrib/bc/tests/fuzzing/dc_inputs/decimal.txt new file mode 100644 index 000000000000..ebbb2dc91b3a --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/decimal.txt @@ -0,0 +1,36 @@ +0pR +0.0pR +.0000pR +000000000000000000000000.00000000000000000000000pR +000000000000000000000000000135482346782356pR +000000000000000000000000002pR +1pR +11pR +123pR +7505pR +1023468723275435238491972521917846pR +4343472432431705867392073517038270398027352709027389273920739037937960379637893607893607893670530278200795207952702873892786172916728961783907893607418973587857386079679267926737520730925372983782793652793pR +_1pR +_203pR +_57pR +_18586pR +_31378682943772818461924738352952347258pR +_823945628745673589495067238723986520375698237620834674509627345273096287563846592384526349872634895763257893467523987578690283762897568459072348758071071087813501875908127359018715023841710239872301387278pR +.123521346523546pR +0.1245923756273856pR +_.1024678456387pR +_0.8735863475634587pR +4.0pR +_6.0pR +234237468293576.000000000000000000000000000000pR +23987623568943567.00000000000000000005677834650000000000000pR +23856934568940675.000000000000000435676782300000000000000456784pR +77567648698496.000000000000000000587674750000000000458563800000000000000pR +2348672354968723.2374823546000000000003256987394502346892435623870000000034578pR +_2354768.000000000000000000000000000000000000pR +_96739874567.000000000347683456pR +_3764568345.000000000004573845000000347683460pR +_356784356.934568495770004586495678300000000pR +74325437345273852773827101738273127312738521733017537073520735207307570358738257390761276072160719802671980267018728630178.7082681027680521760217867841276127681270867827821768173178207830710978017738178678012767377058785378278207385237085237803278203782037237582795870pR +_756752732785273851273728537852738257837283678965738527385272983678372867327835672967385278372637862738627836279863782673862783670.71738178361738718367186378610738617836781603760178367018603760178107735278372832783728367826738627836278378260736270367362073867097307925pR +9812734012837410982345719208345712908357412903587192048571920458712.23957182459817249058172945781pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/divide.txt b/contrib/bc/tests/fuzzing/dc_inputs/divide.txt new file mode 100644 index 000000000000..38b874e9f175 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/divide.txt @@ -0,0 +1,33 @@ +20k +0 1/pR +0 321566/pR +0 0.3984567238456/pR +1 1/pR +1 1287469297356/pR +1 0.2395672438567234/pR +1 237586239856.0293596728392360/pR +1249687284356 3027949207835207/pR +378617298617396719 35748521/pR +9348576237845624358 0.9857829375461/pR +35768293846193284 2374568947.045762839567823/pR +_78987234567812345 876542837618936/pR +_356789237555535468 0.3375273860984786903/pR +_5203475364850390 435742903748307.70869378534043296404530458/pR +_0.37861723347576903 7385770896/pR +_0.399454682043962 0.34824389304/pR +_0.6920414523873204 356489645223.76076045304879030/pR +_35872917389671.7573280963748 73924708/pR +_78375896314.4836709876983 0.78356798637817/pR +_2374123896417.143789621437581 347821469423789.1473856783960/pR +_896729350238549726 _34976289345762/pR +_2374568293458762348596 _0.8792370647234987679/pR +_237584692306721845726038 _21783910782374529637.978102738746189024761/pR +_0.23457980123576298375682 _1375486293874612/pR +_0.173897061862478951264 _0.8179327486017634987516298745/pR +_0.9186739823576829347586 _0.235678293458756239846/pR +_0.9375896183746982374568 _13784962873546.0928729395476283745/pR +_2930754618923467.12323745862937465 _734869238465/pR +_23745861923467.874675129834675 _0.23542357869124756/pR +_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983/pR +1 0.00000000000000000000000000000000000000000002346728372937352457354204563027/pR +239854711289345712 2891374 182 .2893 ///pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/divmod.txt b/contrib/bc/tests/fuzzing/dc_inputs/divmod.txt new file mode 100644 index 000000000000..1633203ff99f --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/divmod.txt @@ -0,0 +1,64 @@ +20k +0 1~pRpR +0 321566~pRpR +0 0.3984567238456~pRpR +1 1~pRpR +1 1287469297356~pRpR +1 0.2395672438567234~pRpR +1 237586239856.0293596728392360~pRpR +1249687284356 3027949207835207~pRpR +378617298617396719 35748521~pRpR +9348576237845624358 0.9857829375461~pRpR +35768293846193284 2374568947.045762839567823~pRpR +_78987234567812345 876542837618936~pRpR +_356789237555535468 0.3375273860984786903~pRpR +_5203475364850390 435742903748307.70869378534043296404530458~pRpR +_0.37861723347576903 7385770896~pRpR +_0.399454682043962 0.34824389304~pRpR +_0.6920414523873204 356489645223.76076045304879030~pRpR +_35872917389671.7573280963748 73924708~pRpR +_78375896314.4836709876983 0.78356798637817~pRpR +_2374123896417.143789621437581 347821469423789.1473856783960~pRpR +_896729350238549726 _34976289345762~pRpR +_2374568293458762348596 _0.8792370647234987679~pRpR +_237584692306721845726038 _21783910782374529637.978102738746189024761~pRpR +_0.23457980123576298375682 _1375486293874612~pRpR +_0.173897061862478951264 _0.8179327486017634987516298745~pRpR +_0.9186739823576829347586 _0.235678293458756239846~pRpR +_0.9375896183746982374568 _13784962873546.0928729395476283745~pRpR +_2930754618923467.12323745862937465 _734869238465~pRpR +_23745861923467.874675129834675 _0.23542357869124756~pRpR +_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983~pRpR +1 0.00000000000000000000000000000000000000000002346728372937352457354204563027~pRpR +0k +0 1~pRpR +0 321566~pRpR +0 0.3984567238456~pRpR +1 1~pRpR +1 1287469297356~pRpR +1 0.2395672438567234~pRpR +1 237586239856.0293596728392360~pRpR +1249687284356 3027949207835207~pRpR +378617298617396719 35748521~pRpR +9348576237845624358 0.9857829375461~pRpR +35768293846193284 2374568947.045762839567823~pRpR +_78987234567812345 876542837618936~pRpR +_356789237555535468 0.3375273860984786903~pRpR +_5203475364850390 435742903748307.70869378534043296404530458~pRpR +_0.37861723347576903 7385770896~pRpR +_0.399454682043962 0.34824389304~pRpR +_0.6920414523873204 356489645223.76076045304879030~pRpR +_35872917389671.7573280963748 73924708~pRpR +_78375896314.4836709876983 0.78356798637817~pRpR +_2374123896417.143789621437581 347821469423789.1473856783960~pRpR +_896729350238549726 _34976289345762~pRpR +_2374568293458762348596 _0.8792370647234987679~pRpR +_237584692306721845726038 _21783910782374529637.978102738746189024761~pRpR +_0.23457980123576298375682 _1375486293874612~pRpR +_0.173897061862478951264 _0.8179327486017634987516298745~pRpR +_0.9186739823576829347586 _0.235678293458756239846~pRpR +_0.9375896183746982374568 _13784962873546.0928729395476283745~pRpR +_2930754618923467.12323745862937465 _734869238465~pRpR +_23745861923467.874675129834675 _0.23542357869124756~pRpR +_3878923750692883.7238596702834756902 _7384192674957215364986723.9738461923487621983~pRpR +1 0.00000000000000000000000000000000000000000002346728372937352457354204563027~pRpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/else.dc b/contrib/bc/tests/fuzzing/dc_inputs/else.dc new file mode 100644 index 000000000000..84deb8754e9f --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/else.dc @@ -0,0 +1,4 @@ +#! /usr/bin/dc +[[Done!]pR]sM[lip1-si0li>LeM]sL10silLx +[[Done!]pR]sM[lip1-si0li!<LeM]sL10silLx +[[Done!]pR]sM[lip1-si0li!=LeM]sL10silLx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/engineering.txt b/contrib/bc/tests/fuzzing/dc_inputs/engineering.txt new file mode 100644 index 000000000000..90a35052b3cb --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/engineering.txt @@ -0,0 +1,19 @@ +1o +0pR +1pR +_34pR +298pR +_8933pR +29488pR +_148232pR +8927559pR +.2pR +_.02pR +.002pR +_.0003pR +.0000209310pR +_.00000289362pR +.000000859289pR +_.02983672pR +.20201296pR +_.8907210897000000000000000000pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/loop.dc b/contrib/bc/tests/fuzzing/dc_inputs/loop.dc new file mode 100644 index 000000000000..26cec23818df --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/loop.dc @@ -0,0 +1,3 @@ +#! /usr/bin/dc +[lip1-si0li>L]sL10silLx +[lip1+si10li<L]sL0silLx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/misc.txt b/contrib/bc/tests/fuzzing/dc_inputs/misc.txt new file mode 100644 index 000000000000..222a3ad265d2 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/misc.txt @@ -0,0 +1 @@ +zp198202389.289374pzp[Hello, World!]pzpzpfrfczpfR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/modexp.txt b/contrib/bc/tests/fuzzing/dc_inputs/modexp.txt new file mode 100644 index 000000000000..a6afb998558e --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/modexp.txt @@ -0,0 +1,103 @@ +0 0 1|pR +1 0 1|pR +1 0 2|pR +0 10 1|pR +1 293 1|pR +1 2789365 2|pR +100 8 7|pR +10922384 15031007 201|pR +3346529 189 254|pR +4113416930 197 14|pR +7709 5887 111|pR +5487406 3252 128|pR +2080527 2279453822 219|pR +48895 50678 232|pR +1535808383 2902995144 18|pR +8437837 2882198 69|pR +35363 25806 2|pR +3221177403 1560419989 189|pR +227 42775 163|pR +2811398069 37500 173|pR +15046850 3859895697 195|pR +15770756 3621999893 119|pR +6937927 3719297189 183|pR +12573 43819 209|pR +42098463 7584603 136|pR +8656683 1328292415 226|pR +209 81 157|pR +141 13317429 26|pR +809485795 60745 101|pR +4882 1388217898 38|pR +750704 78 119|pR +668879580 2888860497 179|pR +1152725844 15295742 154|pR +16160694 8981529 154|pR +216 102 3|pR +3691227289 5344109 232|pR +2195559299 61 222|pR +2478990626 13007440 30|pR +45083 44 117|pR +224 55824 53|pR +1372700133 89 94|pR +205 10422 48|pR +11887 12 73|pR +5955 24353 114|pR +1201697310 789722419 6|pR +56577 231 229|pR +96 38841 189|pR +6529661 5636520 209|pR +11005 15955685 27|pR +9709 231 132|pR +59790 1034579699 166|pR +47892 14536879 79|pR +48 208 21|pR +33036 3877 65|pR +164 6527085 249|pR +12146850 224 37|pR +218 16425679 62|pR +51 27641 95|pR +3076735605 49154 32|pR +515652717 4117874315 143|pR +300672671 720768884 110|pR +9422066 206 5|pR +43 97 13|pR +545174510 65319 126|pR +3317462730 704990271 51|pR +47316 23231 202|pR +7236571 4379567 106|pR +2584584521 2459274189 29|pR +61562 5035178 178|pR +65302 112 151|pR +63040 2168854052 213|pR +9039611 2370306559 62|pR +16414384 1020652061 83|pR +7491 3853569905 172|pR +1180322494 46670 84|pR +3823343557 3865107254 127|pR +6240872 55335 39|pR +2281401897 1098411 251|pR +61 2949190429 231|pR +8981024 162 43|pR +1 3568883218 212|pR +4217100969 3471787779 8|pR +3232237 13 243|pR +29280 3972452706 100|pR +13077 6431923 216|pR +104 3098510775 140|pR +9503298 174 242|pR +3424695712 12184 23|pR +184 15066347 151|pR +2935856 14003205 184|pR +1386637762 2128151420 71|pR +154 11960656 12|pR +743976432 4004778779 136|pR +3909160595 3575680922 21|pR +26133 3580 147|pR +409154 170 68|pR +149 55629 40|pR +5753 13776176 32|pR +3831447473 658273178 98|pR +1527252003 2300622 207|pR +3363824553 8244645 215|pR +20 145 101|pR +4005077294 2196555621 94|pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/modulus.txt b/contrib/bc/tests/fuzzing/dc_inputs/modulus.txt new file mode 100644 index 000000000000..613944b2001a --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/modulus.txt @@ -0,0 +1,70 @@ +20k +1 1%pR +2 1%pR +16 4%pR +15 4%pR +17 4%pR +2389473 5%pR +39240687239 1%pR +346728934 23958%pR +3496723859067234 298375462837546928347623059375486%pR +_1 1%pR +_2 1%pR +_47589634875689345 37869235%pR +_1274852934765 2387628935486273546%pR +_6324758963 237854962%pR +1 _1%pR +2 _1%pR +2 _2%pR +2 _3%pR +16 5%pR +15 5%pR +14 5%pR +89237423 _237856923854%pR +123647238946 _12467%pR +_1 _1%pR +_2 _1%pR +_2 _2%pR +_2 _3%pR +_13 _7%pR +_14 _7%pR +_15 _7%pR +_12784956 _32746%pR +_127849612 _23712347682193%pR +0k +1 1%pR +2 1%pR +16 4%pR +15 4%pR +17 4%pR +2389473 5%pR +39240687239 1%pR +346728934 23958%pR +3496723859067234 298375462837546928347623059375486%pR +_1 1%pR +_2 1%pR +_47589634875689345 37869235%pR +_1274852934765 2387628935486273546%pR +_6324758963 237854962%pR +1 _1%pR +2 _1%pR +2 _2%pR +2 _3%pR +16 5%pR +15 5%pR +14 5%pR +89237423 _237856923854%pR +123647238946 _12467%pR +_1 _1%pR +_2 _1%pR +_2 _2%pR +_2 _3%pR +_13 _7%pR +_14 _7%pR +_15 _7%pR +_12784956 _32746%pR +_127849612 _23712347682193%pR +_3191280681 641165986%pR +0k _899510228 _2448300078.40314%pR +0k _7424863 _207.2609738667%pR +0k 3769798918 0.6%pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/multiply.txt b/contrib/bc/tests/fuzzing/dc_inputs/multiply.txt new file mode 100644 index 000000000000..1f9041d06ea7 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/multiply.txt @@ -0,0 +1,42 @@ +0 0*pR +0.000 0*pR +1 0*pR +0 1*pR +0 2498752389672835476*pR +873246913745129084576134 0*pR +1 472638590273489273456*pR +12374861230476103672835496 1*pR +1 1*pR +2 1*pR +1 2*pR +2 2*pR +3 14*pR +17 8*pR +1892467513846753 1872439821374591038746*pR +328962735862.2973546835638947635 1728465791348762356*pR +38745962374538.387427384672934867234 0.1932476528394672837568923754*pR +9878894576289457634856.2738627161689017387608947567654 37842939768237596237854203.29874372139852739126739621793162*pR +_1 1*pR +_1 2*pR +78893457 _34876238956*pR +235678324957634 _0.2349578349672389576*pR +_12849567821934 12738462937681*pR +1274861293467.927843682937462 _28935678239*pR +2936077239872.12937462836 _0.012842357682435762*pR +2387692387566.2378569237546 _272189345628.123875629835876*pR +0.012348629356782835962 _23487692356*pR +0.4768349567348675934 _0.23756834576934857638495*pR +0.98748395367485962735486 _4675839462354867.376834956738456*pR +_321784627934586 _235762378596*pR +_32578623567892356 _0.32567384579638456*pR +_35768232346876 _2348672935602387620.28375682349576237856*pR +_0.2356728394765234 _238759624356978*pR +_0.2345768212346780 _0.235768124697074385948943532045*pR +_0.370873860736785306278630 _7835678398607.7086378076867096270*pR +_78365713707.7089637863786730 _738580798679306780*pR +_73867038956790490258249 _0.7379862716391723672803679*pR +_378621971598721837710387 _98465373878350798.09743896037963078560*pR +37164201 2931559660*pR +679468076118972457796560530571.46287161642138401685 93762.2836*pR +.000000000000000000000000001 .0000000000000000000000001*pR +239 289 _98 .8937 _.1893 28937*****pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/places.txt b/contrib/bc/tests/fuzzing/dc_inputs/places.txt new file mode 100644 index 000000000000..308ff1373d64 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/places.txt @@ -0,0 +1,14 @@ +0 0@pR +1 0@pR +2 0@pR +0.0023896 0@pR +1.298346 0@pR +2.00000000 0@pR +0.0023896 3@pR +1.298346 4@pR +2.00000000 5@pR +289 3@pR +18.34 6@pR +_183.1 0@pR +_23.238 8@pR +_343.23 2@pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/power.txt b/contrib/bc/tests/fuzzing/dc_inputs/power.txt new file mode 100644 index 000000000000..955e42557a15 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/power.txt @@ -0,0 +1,36 @@ +20k +0 0^pR +0 1^pR +0 1894^pR +1 0^pR +39746823 0^pR +0.238672983047682 0^pR +18394762374689237468.97354862973846 0^pR +1 1^pR +2 1^pR +18927361346 1^pR +0.23523785962738592635777 1^pR +328956734869213746.89782398457234 1^pR +8937 8^pR +93762.2836 3^pR +1 _1^pR +2 _1^pR +10 _1^pR +683734768 _1^pR +38579623756.897937568235 _1^pR +1 _32467^pR +2 _53^pR +_1 1^pR +_1 2^pR +_2 1^pR +_2 2^pR +_237 294^pR +_3746 28^pR +_0.3548 35^pR +_1 _1^pR +_1 _2^pR +_2 _1^pR +_2 _2^pR +_86 _7^pR +0 _251^pR +_0.2959371298 27^pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/quit.dc b/contrib/bc/tests/fuzzing/dc_inputs/quit.dc new file mode 100644 index 000000000000..81e6289af25b --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/quit.dc @@ -0,0 +1,2 @@ +1se [li p 1+si le li !=lem]sl [lk p 1+sk le lk !=o]so [0sk lox leQ 0sk lox le 3*1+Q 0sk lox]sm [0si llx le 1+se 10 le !=n]dsnx +1si [li p 1+si 10 li !=set]ss [1000Q]st lsx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/scientific.txt b/contrib/bc/tests/fuzzing/dc_inputs/scientific.txt new file mode 100644 index 000000000000..59a78dbb3a6c --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/scientific.txt @@ -0,0 +1,51 @@ +0e0pR +0e1pR +0e5pR +0e_2pR +0e_100pR +1e0pR +_1e1pR +1e9pR +_1e21pR +1e_1pR +_1e_2pR +1e_5pR +4.92837e5pR +_3.28971028e20pR +6.2e3pR +_8.289371e2pR +5.9817280937e8pR +_3.28977e_1pR +8.8927891e_20pR +_7.98239e_4pR +4.4892e_4pR +_18937e0pR +198273e10pR +_18927e_4pR +28937e_5pR +_891072e_7pR +.28972e0pR +_.891273e_1pR +.8928397e1pR +_.0002983172e5pR +.00022e3pR +_.00022e4pR +.0000328937e8pR +0o +0pR +1pR +10pR +_289pR +2894pR +_89434pR +894370pR +_1239839pR +28931708pR +_8052098.8029731809pR +.1pR +_.01pR +.001pR +_.00038pR +.0000483pR +_.0002894378190pR +.2893712083pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/shift.txt b/contrib/bc/tests/fuzzing/dc_inputs/shift.txt new file mode 100644 index 000000000000..628b0a5bf6fe --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/shift.txt @@ -0,0 +1,42 @@ +0 0HpR +1 0HpR +2 0HpR +0.0023896 0HpR +1.298346 0HpR +2.00000000 0HpR +0.0023896 3HpR +1.298346 4HpR +2.00000000 5HpR +89136.892348976 7HpR +1892634051829351283289298 24HpR +0 0hpR +1 0hpR +2 0hpR +0.0023896 0hpR +1.298346 0hpR +2.00000000 0hpR +0.0023896 3hpR +1.298346 4hpR +2.00000000 5hpR +89136.892348976 7hpR +1892634051829351283289298 24hpR +_1 0HpR +_2 0HpR +_0.0023896 0HpR +_1.298346 0HpR +_2.00000000 0HpR +_0.0023896 3HpR +_1.298346 4HpR +_2.00000000 5HpR +_89136.892348976 7HpR +_1892634051829351283289298 24HpR +_1 0hpR +_2 0hpR +_0.0023896 0hpR +_1.298346 0hpR +_2.00000000 0hpR +_0.0023896 3hpR +_1.298346 4hpR +_2.00000000 5hpR +_89136.892348976 7hpR +_1892634051829351283289298 24hpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt b/contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt new file mode 100644 index 000000000000..7c13fdd0bb5d --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/sqrt.txt @@ -0,0 +1,14 @@ +20k +0vpR +2vpR +4vpR +9vpR +16vpR +25vpR +121vpR +48765vpR +9287356207356vpR +0.189274385967238956872354vpR +12389467137496823.134567829387456283946vpR +.0000000000000000000000000000123vpR +1vpR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/stdin.txt b/contrib/bc/tests/fuzzing/dc_inputs/stdin.txt new file mode 100644 index 000000000000..7bf8316b99af --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/stdin.txt @@ -0,0 +1,205 @@ +0si[lid:rli1+sili10>x]dsxxli1-si[li;rpRli1-sili0!>x]dsxxli1+si[li;rpRli1+sili10>x]dsxx0sx0si +1 2+p +[foo] +0 +1+p +2+p +3+p +4+p +5+p +6+p +7+p +8+p +9+p +10+p +11+p +12+p +13+p +14+p +15+p +16+p +17+p +18+p +19+p +20+p +21+p +22+p +23+p +24+p +25+p +26+p +27+p +28+p +29+p +30+p +31+p +32+p +33+p +34+p +35+p +36+p +37+p +38+p +39+p +40+p +41+p +42+p +43+p +44+p +45+p +46+p +47+p +48+p +49+p +50+p +51+p +52+p +53+p +54+p +55+p +56+p +57+p +58+p +59+p +60+p +61+p +62+p +63+p +64+p +65+p +66+p +67+p +68+p +69+p +70+p +71+p +72+p +73+p +74+p +75+p +76+p +77+p +78+p +79+p +80+p +81+p +82+p +83+p +84+p +85+p +86+p +87+p +88+p +89+p +90+p +91+p +92+p +93+p +94+p +95+p +96+p +97+p +98+p +99+p +100+p +101+p +102+p +103+p +104+p +105+p +106+p +107+p +108+p +109+p +110+p +111+p +112+p +113+p +114+p +115+p +116+p +117+p +118+p +119+p +120+p +121+p +122+p +123+p +124+p +125+p +126+p +127+p +128+p +129+p +130+p +131+p +132+p +133+p +134+p +135+p +136+p +137+p +138+p +139+p +140+p +141+p +142+p +143+p +144+p +145+p +146+p +147+p +148+p +149+p +150+p +151+p +152+p +153+p +154+p +155+p +156+p +157+p +158+p +159+p +160+p +161+p +162+p +163+p +164+p +165+p +166+p +167+p +168+p +169+p +170+p +171+p +172+p +173+p +174+p +175+p +176+p +177+p +178+p +179+p +180+p +181+p +182+p +183+p +184+p +185+p +186+p +187+p +188+p +189+p +190+p +191+p +192+p +193+p +194+p +195+p +196+p +197+p +198+p +199+p +200+p +p diff --git a/contrib/bc/tests/fuzzing/dc_inputs/stream.dc b/contrib/bc/tests/fuzzing/dc_inputs/stream.dc new file mode 100755 index 000000000000..5c61e7c931f9 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/stream.dc @@ -0,0 +1,2 @@ +#! /usr/bin/dc +0si[liPlid1+sili4096>x]ddsxPx diff --git a/contrib/bc/tests/fuzzing/dc_inputs/strings.txt b/contrib/bc/tests/fuzzing/dc_inputs/strings.txt new file mode 100644 index 000000000000..369d8e1dd842 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/strings.txt @@ -0,0 +1,50 @@ +[Hello, World!]ZpR +[Hello, World!]pR +[Hello, \[ World!]ZpR +[Hello, \[ World!]pR +[Hello, \] World!]ZpR +[Hello, \] World!]pR +[30pR] +[29pR] +[28pR] +[27pR] +[26pR] +[25pR] +[24pR] +[23pR] +[22pR] +[21pR] +[20pR] +[19pR] +[18pR] +[17pR] +[16pR] +[15pR] +[14pR] +[13pR] +[12pR] +[11pR] +[10pR] +[9pR] +[8pR] +[7pR] +[6pR] +[5pR] +[4pR] +[3pR] +[2pR] +[1pR] +[xz0<x]dsxx +[\\]pR +[\[\]]pR +1xpR +[1st] 0:b [2nd] 1:b 0;b p 1;b p +[string]XpR +[3 4^pR]silix +[[[q 1 3+pR]x]x]x4 5^pR +4xpR +5 112ax 90ax 112ax 82ax +[\q] pR +[q\\] pR +[\\] pR +92 a pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/subtract.txt b/contrib/bc/tests/fuzzing/dc_inputs/subtract.txt new file mode 100644 index 000000000000..2cb4104fb717 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/subtract.txt @@ -0,0 +1,33 @@ +0 0-pR +0 1-pR +1 0-pR +1 1-pR +5 2-pR +2 9-pR +321974 12845976238457-pR +2874519803456710938465 384723854-pR +10000000000000000000000000000000000000000 999999999999999999999999999999999999999-pR +10000000000000000000000000000000000000000 9999999999999999999999999999999999999999-pR +10000000000000000000000000000000000000000 999999999999999999999999999999999999999.99999999999999999999999999999999999-pR +10000000000000000000000000000000000000000 9999999999999999999999999999999999999999.9999999999999999999999999999999999-pR +10000000000000000000000000000000000000000 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001-pR +10000000000000000000000000000000000000001 0.00000000000000000000000000000000000000000000000000000000000000000000000000000000000001-pR +10000000000000000000000000000000000000000.0000000001 0.0000000000000000000000000000000000000000000000000000000000000000000000000001-pR +_2 6-pR +_23784692345 182934721309467230894628735496027345-pR +_224352354962873059862 _1245723576829456278354960278345-pR +_3468273598 _12354243-pR +_0.92345768293 _2354768923-pR +_712384634.123476823 _24768293376-pR +_1879234638 _0.917234869234-pR +_0.9172438692134 _0.971284967124-pR +_0.1283475123465 _0.937462346-pR +_124765829346.2837468293562 _0.923467829346-pR +_12476829385769 _1928476259034.8378629356-pR +_0.38476284395876345 _94875394587623.2357869324857-pR +_4674596708467.34754789403674343567 _48672394852354698.237548629345-pR +979519669 3018100865-pR +929002449 3280677283-pR +0 _525898-pR +3 _3-pR +2 _1 2893714 _2189367411289 _.8921374 3.9201384----pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/trunc.txt b/contrib/bc/tests/fuzzing/dc_inputs/trunc.txt new file mode 100644 index 000000000000..684752e065dd --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/trunc.txt @@ -0,0 +1,11 @@ +0$pR +1$pR +2$pR +0.8249167203486$pR +1.28937150237$pR +2.0$pR +28937.92837605126$pR +2890.000000000$pR +_1$pR +_1.128973$pR +_9812387.28910273$pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/vars.txt b/contrib/bc/tests/fuzzing/dc_inputs/vars.txt new file mode 100644 index 000000000000..bbe73b47d81f --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/vars.txt @@ -0,0 +1,2 @@ +298734.8921702348sx_928374892.28937syzpRlxly+pR +298734.8921702348S xotj _928374892.28937S yotp zpRl xotj l yotp-pRzpR L xotj L yotp-pR diff --git a/contrib/bc/tests/fuzzing/dc_inputs/weird.dc b/contrib/bc/tests/fuzzing/dc_inputs/weird.dc new file mode 100644 index 000000000000..391ec05d6282 --- /dev/null +++ b/contrib/bc/tests/fuzzing/dc_inputs/weird.dc @@ -0,0 +1,2 @@ +#! /usr/bin/dc +zp198202389.289374pzp[He World!]SzpzXfrfxzpfR diff --git a/contrib/bc/tests/other.sh b/contrib/bc/tests/other.sh new file mode 100755 index 000000000000..8c56e25d2395 --- /dev/null +++ b/contrib/bc/tests/other.sh @@ -0,0 +1,271 @@ +#! /bin/sh +# +# SPDX-License-Identifier: BSD-2-Clause +# +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# +# * Redistributions of source code must retain the above copyright notice, this +# list of conditions and the following disclaimer. +# +# * Redistributions in binary form must reproduce the above copyright notice, +# this list of conditions and the following disclaimer in the documentation +# and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +set -e + +script="$0" +testdir=$(dirname "$script") + +. "$testdir/../functions.sh" + +if [ "$#" -ge 1 ]; then + d="$1" + shift +else + err_exit "usage: $script dir [exec args...]" 1 +fi + +if [ "$#" -lt 1 ]; then + exe="$testdir/../bin/$d" +else + exe="$1" + shift +fi + +if [ "$d" = "bc" ]; then + halt="quit" +else + halt="q" +fi + +num=100000000000000000000000000000000000000000000000000000000000000000000000000000 +numres="$num" +num70="10000000000000000000000000000000000000000000000000000000000000000000\\ +0000000000" + +if [ "$d" = "bc" ]; then + halt="halt" + opt="x" + lopt="extended-register" + line_var="BC_LINE_LENGTH" +else + halt="q" + opt="l" + lopt="mathlib" + line_var="DC_LINE_LENGTH" + num="$num pR" +fi + +set +e + +printf '\nRunning %s quit test...' "$d" + +printf '%s\n' "$halt" | "$exe" "$@" > /dev/null 2>&1 + +checktest_retcode "$d" "$?" "quit" + +if [ "$d" = bc ]; then + + printf '%s\n' "quit" | "$exe" "$@" > /dev/null 2>&1 + + checktest_retcode "$d" "$?" quit + + two=$("$exe" "$@" -e 1+1 -e quit) + + checktest_retcode "$d" "$?" quit + + if [ "$two" != "2" ]; then + err_exit "$d failed test quit" 1 + fi +fi + +printf 'pass\n' + +base=$(basename "$exe") + +if [ "$base" != "bc" -a "$base" != "dc" ]; then + exit 0 +fi + +printf 'Running %s environment var tests...' "$d" + +if [ "$d" = "bc" ]; then + + export BC_ENV_ARGS=" '-l' '' -q" + export BC_EXPR_EXIT="1" + + printf 's(.02893)\n' | "$exe" "$@" > /dev/null + + checktest_retcode "$d" "$?" "environment var" + + "$exe" -e 4 "$@" > /dev/null + + err="$?" + checktest_retcode "$d" "$?" "environment var" +else + + export DC_ENV_ARGS="'-x'" + export DC_EXPR_EXIT="1" + + printf '4s stuff\n' | "$exe" "$@" > /dev/null + + checktest_retcode "$d" "$?" "environment var" + + "$exe" -e 4pR "$@" > /dev/null + + checktest_retcode "$d" "$?" "environment var" +fi + +printf 'pass\n' + +out1="$testdir/../.log_$d.txt" +out2="$testdir/../.log_${d}_test.txt" + +printf 'Running %s line length tests...' "$d" + +printf '%s\n' "$numres" > "$out1" + +export "$line_var"=80 +printf '%s\n' "$num" | "$exe" "$@" > "$out2" + +checktest "$d" "$?" "environment var" "$out1" "$out2" + +printf '%s\n' "$num70" > "$out1" + +export "$line_var"=2147483647 +printf '%s\n' "$num" | "$exe" "$@" > "$out2" + +checktest "$d" "$?" "environment var" "$out1" "$out2" + +printf 'pass\n' + +printf 'Running %s arg tests...' "$d" + +f="$testdir/$d/add.txt" +exprs=$(cat "$f") +results=$(cat "$testdir/$d/add_results.txt") + +printf '%s\n%s\n%s\n%s\n' "$results" "$results" "$results" "$results" > "$out1" + +"$exe" "$@" -e "$exprs" -f "$f" --expression "$exprs" --file "$f" -e "$halt" > "$out2" + +checktest "$d" "$?" "arg" "$out1" "$out2" + +printf '%s\n' "$halt" | "$exe" "$@" -- "$f" "$f" "$f" "$f" > "$out2" + +checktest "$d" "$?" "arg" "$out1" "$out2" + +if [ "$d" = "bc" ]; then + printf '%s\n' "$halt" | "$exe" "$@" -i > /dev/null 2>&1 +fi + +printf '%s\n' "$halt" | "$exe" "$@" -h > /dev/null +checktest_retcode "$d" "$?" "arg" +printf '%s\n' "$halt" | "$exe" "$@" -P > /dev/null +checktest_retcode "$d" "$?" "arg" +printf '%s\n' "$halt" | "$exe" "$@" -v > /dev/null +checktest_retcode "$d" "$?" "arg" +printf '%s\n' "$halt" | "$exe" "$@" -V > /dev/null +checktest_retcode "$d" "$?" "arg" + +"$exe" "$@" -f "saotehasotnehasthistohntnsahxstnhalcrgxgrlpyasxtsaosysxsatnhoy.txt" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "invalid file argument" "$out2" "$d" + +"$exe" "$@" "-$opt" -e "$exprs" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "invalid option argument" "$out2" "$d" + +"$exe" "$@" "--$lopt" -e "$exprs" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "invalid long option argument" "$out2" "$d" + +"$exe" "$@" "-u" -e "$exprs" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "unrecognized option argument" "$out2" "$d" + +"$exe" "$@" "--uniform" -e "$exprs" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "unrecognized long option argument" "$out2" "$d" + +"$exe" "$@" -f > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "missing required argument to short option" "$out2" "$d" + +"$exe" "$@" --file > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "missing required argument to long option" "$out2" "$d" + +"$exe" "$@" --version=5 > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "given argument to long option with no argument" "$out2" "$d" + +printf 'pass\n' + +printf 'Running %s directory test...' "$d" + +"$exe" "$@" "$testdir" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "directory" "$out2" "$d" + +printf 'pass\n' + +printf 'Running %s binary file test...' "$d" + +bin="/bin/sh" + +"$exe" "$@" "$bin" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "binary file" "$out2" "$d" + +printf 'pass\n' + +printf 'Running %s binary stdin test...' "$d" + +cat "$bin" | "$exe" "$@" > /dev/null 2> "$out2" +err="$?" + +checkerrtest "$d" "$err" "binary stdin" "$out2" "$d" + +printf 'pass\n' + +if [ "$d" = "bc" ]; then + + printf 'Running %s limits tests...' "$d" + printf 'limits\n' | "$exe" "$@" > "$out2" /dev/null 2>&1 + + checktest_retcode "$d" "$?" "limits" + + if [ ! -s "$out2" ]; then + err_exit "$d did not produce output on the limits test" 1 + fi + + exec printf 'pass\n' + +fi diff --git a/contrib/bc/tests/radamsa.sh b/contrib/bc/tests/radamsa.sh index 537ee10255c3..236953ae888e 100755 --- a/contrib/bc/tests/radamsa.sh +++ b/contrib/bc/tests/radamsa.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/tests/randmath.py b/contrib/bc/tests/randmath.py index 7f14a345be3e..ca226324a8dc 100755 --- a/contrib/bc/tests/randmath.py +++ b/contrib/bc/tests/randmath.py @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: diff --git a/contrib/bc/tests/read.sh b/contrib/bc/tests/read.sh index 0440a078d36c..e9d306858ec3 100755 --- a/contrib/bc/tests/read.sh +++ b/contrib/bc/tests/read.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -57,7 +57,12 @@ name="$testdir/$d/read.txt" results="$testdir/$d/read_results.txt" errors="$testdir/$d/read_errors.txt" -out="$testdir/../.log_${d}_test.txt" +out="$testdir/${d}_outputs/read_results.txt" +outdir=$(dirname "$out") + +if [ ! -d "$outdir" ]; then + mkdir -p "$outdir" +fi exebase=$(basename "$exe") @@ -79,17 +84,17 @@ fi printf 'Running %s read...' "$d" +set +e + while read line; do printf '%s\n%s\n' "$read_call" "$line" | "$exe" "$@" "$options" > "$out" - diff "$results" "$out" + checktest "$d" "$?" 'read' "$results" "$out" done < "$name" printf 'pass\n' -set +e - printf 'Running %s read errors...' "$d" while read line; do @@ -97,7 +102,7 @@ while read line; do printf '%s\n%s\n' "$read_call" "$line" | "$exe" "$@" "$options" 2> "$out" > /dev/null err="$?" - checktest "$d" "$err" "$line" "$out" "$exebase" + checkerrtest "$d" "$err" "$line" "$out" "$exebase" done < "$errors" @@ -110,7 +115,7 @@ read_test=$(printf '%s\n' "$read_call") printf '%s\n' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null err="$?" -checktest "$d" "$err" "$read_test" "$out" "$exebase" +checkerrtest "$d" "$err" "$read_test" "$out" "$exebase" printf 'pass\n' @@ -121,6 +126,6 @@ read_test=$(printf '%s' "$read_call") printf '%s' "$read_test" | "$exe" "$@" "$opts" 2> "$out" > /dev/null err="$?" -checktest "$d" "$err" "$read_test" "$out" "$exebase" +checkerrtest "$d" "$err" "$read_test" "$out" "$exebase" -printf 'pass\n' +exec printf 'pass\n' diff --git a/contrib/bc/tests/script.sh b/contrib/bc/tests/script.sh index 279295829f75..acd68f6d9bc3 100755 --- a/contrib/bc/tests/script.sh +++ b/contrib/bc/tests/script.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -33,6 +33,8 @@ script="$0" testdir=$(dirname "${script}") +. "$testdir/../functions.sh" + if [ "$#" -lt 2 ]; then printf 'usage: %s dir script [run_extra_tests] [run_stack_tests] [generate_tests] [time_tests] [exec args...]\n' "$script" exit 1 @@ -79,8 +81,6 @@ else exe="$testdir/../bin/$d" fi -out="$testdir/../.log_${d}_test.txt" - if [ "$d" = "bc" ]; then if [ "$run_stack_tests" -ne 0 ]; then @@ -120,6 +120,18 @@ if [ "$run_stack_tests" -eq 0 ]; then fi +out="$testdir/${d}_outputs/${name}_script_results.txt" +outdir=$(dirname "$out") + +if [ ! -d "$outdir" ]; then + mkdir -p "$outdir" +fi + +unset BC_ENV_ARGS +unset BC_LINE_LENGTH +unset DC_ENV_ARGS +unset DC_LINE_LENGTH + s="$scriptdir/$f" orig="$testdir/$name.txt" results="$scriptdir/$name.txt" @@ -138,18 +150,22 @@ else res="$results" fi +set +e + printf 'Running %s script %s...' "$d" "$f" if [ "$time_tests" -ne 0 ]; then printf '\n' printf '%s\n' "$halt" | /usr/bin/time -p "$exe" "$@" $options "$s" > "$out" + err="$?" printf '\n' else printf '%s\n' "$halt" | "$exe" "$@" $options "$s" > "$out" + err="$?" fi -diff "$res" "$out" +checktest "$d" "$err" "script $f" "$res" "$out" rm -f "$out" -printf 'pass\n' +exec printf 'pass\n' diff --git a/contrib/bc/tests/scripts.sh b/contrib/bc/tests/scripts.sh index ff17260c909c..a0415ec7fffb 100755 --- a/contrib/bc/tests/scripts.sh +++ b/contrib/bc/tests/scripts.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -78,9 +78,12 @@ fi scriptdir="$testdir/$d/scripts" -for s in $scriptdir/*.$d; do +scripts=$(cat "$scriptdir/all.txt") + +for s in $scripts; do f=$(basename "$s") - sh "$testdir/script.sh" "$d" "$f" "$run_extra_tests" "$run_stack_tests" "$generate" "$time_tests" "$exe" "$@" + sh "$testdir/script.sh" "$d" "$f" "$run_extra_tests" "$run_stack_tests" \ + "$generate" "$time_tests" "$exe" "$@" done diff --git a/contrib/bc/tests/stdin.sh b/contrib/bc/tests/stdin.sh index f66019d5ae65..581a6df52d73 100755 --- a/contrib/bc/tests/stdin.sh +++ b/contrib/bc/tests/stdin.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -33,6 +33,8 @@ script="$0" testdir=$(dirname "$script") +. "$testdir/../functions.sh" + if [ "$#" -lt 1 ]; then printf 'usage: %s dir [exe [args...]]\n' "$0" printf 'valid dirs are:\n' @@ -52,7 +54,12 @@ else exe="$testdir/../bin/$d" fi -out="$testdir/../.log_${d}_test.txt" +out="$testdir/${d}_outputs/stdin_results.txt" +outdir=$(dirname "$out") + +if [ ! -d "$outdir" ]; then + mkdir -p "$outdir" +fi if [ "$d" = "bc" ]; then options="-ilq" @@ -62,20 +69,22 @@ fi rm -f "$out" +set +e + printf 'Running %s stdin tests...' "$d" cat "$testdir/$d/stdin.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null -diff "$testdir/$d/stdin_results.txt" "$out" +checktest "$d" "$?" "stdin" "$testdir/$d/stdin_results.txt" "$out" if [ "$d" = "bc" ]; then cat "$testdir/$d/stdin1.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null - diff "$testdir/$d/stdin1_results.txt" "$out" + checktest "$d" "$?" "stdin" "$testdir/$d/stdin1_results.txt" "$out" cat "$testdir/$d/stdin2.txt" | "$exe" "$@" "$options" > "$out" 2> /dev/null - diff "$testdir/$d/stdin2_results.txt" "$out" + checktest "$d" "$?" "stdin" "$testdir/$d/stdin2_results.txt" "$out" fi -rm -f "$out1" +rm -f "$out" -printf 'pass\n' +exec printf 'pass\n' diff --git a/contrib/bc/tests/test.sh b/contrib/bc/tests/test.sh index 20f95413597b..c6c4cc250ba3 100755 --- a/contrib/bc/tests/test.sh +++ b/contrib/bc/tests/test.sh @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: BSD-2-Clause # -# Copyright (c) 2018-2020 Gavin D. Howard and contributors. +# Copyright (c) 2018-2021 Gavin D. Howard and contributors. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: @@ -33,6 +33,8 @@ script="$0" testdir=$(dirname "$script") +. "$testdir/../functions.sh" + if [ "$#" -lt 2 ]; then printf 'usage: %s dir test [generate_tests] [time_tests] [exe [args...]]\n' "$0" printf 'valid dirs are:\n' @@ -71,7 +73,17 @@ else exe="$testdir/../bin/$d" fi -out="$testdir/../.log_${d}_test.txt" +out="$testdir/${d}_outputs/${t}_results.txt" +outdir=$(dirname "$out") + +if [ ! -d "$outdir" ]; then + mkdir -p "$outdir" +fi + +unset BC_ENV_ARGS +unset BC_LINE_LENGTH +unset DC_ENV_ARGS +unset DC_LINE_LENGTH if [ "$d" = "bc" ]; then options="-lq" @@ -83,14 +95,6 @@ else halt="q" fi -if [ "${exe#*toybox}" != "$exe" -o "${exe#*busybox}" != "$exe" ]; then - if [ "$t" = "print2" -o "$t" = "misc4" ]; then - base=$(basename "$exe") - printf 'Skipping %s test for %s...\n' "$t" "$base" - exit 0 - fi -fi - if [ ! -f "$name" ]; then if [ "$generate_tests" -eq 0 ]; then @@ -115,18 +119,22 @@ fi export $var=string +set +e + printf 'Running %s %s...' "$d" "$t" if [ "$time_tests" -ne 0 ]; then printf '\n' printf '%s\n' "$halt" | /usr/bin/time -p "$exe" "$@" $options "$name" > "$out" + err="$?" printf '\n' else printf '%s\n' "$halt" | "$exe" "$@" $options "$name" > "$out" + err="$?" fi -diff "$results" "$out" +checktest "$d" "$err" "$t" "$results" "$out" rm -f "$out" -printf 'pass\n' +exec printf 'pass\n' |