aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mikisabate@gmail.com>2025-09-03 19:08:05 +0200
committerMiquel Sabaté Solà <mikisabate@gmail.com>2025-09-03 20:45:54 +0200
commit9dcbf460ff692c049e4d327afcbdbc39ba4e8c65 (patch)
tree1d96e2bccc566a3092768da691e7ca47881880de /scripts
parenta3989fb9c5424f2f93c67669102ee8cb61303c24 (diff)
downloadtools.nes-9dcbf460ff692c049e4d327afcbdbc39ba4e8c65.tar.gz
tools.nes-9dcbf460ff692c049e4d327afcbdbc39ba4e8c65.zip
Validate that memory access is done via variables
The address sanitizer is now able to detect whenever in an instruction a memory access is done without using variables. This is now detected for all instructions except for branching, which falls outside of this scope. Moreover, simple arithmetics is allowed and bounds are checked for simple cases. That being said, more involved bound checks should be done with other tools (e.g. emulators). Signed-off-by: Miquel Sabaté Solà <mikisabate@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/test-e2e.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh
index 9da3a31..ab7312b 100755
--- a/scripts/test-e2e.sh
+++ b/scripts/test-e2e.sh
@@ -52,9 +52,15 @@ exit_code=$((exit_code + $?))
echo "test: custom => unused.nes"
./target/debug/nasm -c empty --asan -o tests/out/unused.nes tests/unused.s 2>tests/out/unused-warning.txt
diff tests/out/unused-warning.txt tests/expected/unused-warning.txt
+exit_code=$((exit_code + $?))
diff tests/out/unused.nes tests/expected/unused.nes
exit_code=$((exit_code + $?))
+echo "test: custom => bare_accesses.nes"
+./target/debug/nasm -c empty --asan tests/bare_accesses.s 2>tests/out/bare_accesses.txt
+diff tests/out/bare_accesses.txt tests/expected/bare_accesses.txt
+exit_code=$((exit_code + $?))
+
##
# code.nes