diff options
| author | Miquel Sabaté Solà <mssola@mssola.com> | 2026-10-09 21:45:05 +0200 |
|---|---|---|
| committer | Miquel Sabaté Solà <mssola@mssola.com> | 2026-10-09 21:45:05 +0200 |
| commit | f6df4314945c1d37d314a7c88553b97b23c748e9 (patch) | |
| tree | 20e71c89c25f469a83c52528dfdfe0ed71a8c3e1 /scripts/test-e2e.sh | |
| parent | aa5174fc055dc66e78a8aa7030c018e43cf588a1 (diff) | |
| download | tools.nes-f6df4314945c1d37d314a7c88553b97b23c748e9.tar.gz tools.nes-f6df4314945c1d37d314a7c88553b97b23c748e9.zip | |
vnf,runrom: detect bad data access
This includes detection for:
- Stack underflows (it was theoretically already there but it had never
been properly tested).
- Load/store out of bounds for a given variable known via the .nasm/
directory.
- Load out of bounds on a set of data referenced via a raw label (see
commit aa5174fc055d ("xixanta: Add an hint for the ending of data
labels")).
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'scripts/test-e2e.sh')
| -rwxr-xr-x | scripts/test-e2e.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh index 0cf37f0..17766a4 100755 --- a/scripts/test-e2e.sh +++ b/scripts/test-e2e.sh @@ -351,6 +351,25 @@ exit_code=$((exit_code + $?)) diff tests/out/misc-foo.txt tests/expected/runrom/misc-foo.txt exit_code=$((exit_code + $?)) +echo "test: runrom => overflows.nes" +./target/debug/nasm -Werror --asan --write-info --out tests/out/overflows.nes tests/runrom/overflows.s + +./target/debug/runrom --nasm .nasm/ --dump-memory --function tests/out/overflows.nes &> tests/out/overflow-reset.txt +diff tests/out/overflow-reset.txt tests/expected/runrom/overflow-reset.txt +exit_code=$((exit_code + $?)) + +./target/debug/runrom --nasm .nasm/ --dump-memory --function --start overflow_on_arithmetics tests/out/overflows.nes &> tests/out/overflow-arithmetics.txt +diff tests/out/overflow-arithmetics.txt tests/expected/runrom/overflow-arithmetics.txt +exit_code=$((exit_code + $?)) + +./target/debug/runrom --nasm .nasm/ --dump-memory --function --start stack_underflow tests/out/overflows.nes &> tests/out/overflow-stack.txt +diff tests/out/overflow-stack.txt tests/expected/runrom/overflow-stack.txt +exit_code=$((exit_code + $?)) + +./target/debug/runrom --nasm .nasm/ --dump-memory --function --start bad_rom_data_indexing tests/out/overflows.nes &> tests/out/overflow-data-indexing.txt +diff tests/out/overflow-data-indexing.txt tests/expected/runrom/overflow-data-indexing.txt +exit_code=$((exit_code + $?)) + ## # vnf-tests |
