From 9dcbf460ff692c049e4d327afcbdbc39ba4e8c65 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Wed, 3 Sep 2025 19:08:05 +0200 Subject: Validate that memory access is done via variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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à --- scripts/test-e2e.sh | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'scripts/test-e2e.sh') 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 -- cgit v1.2.3