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à --- tests/expected/bare_accesses.txt | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 tests/expected/bare_accesses.txt (limited to 'tests/expected') diff --git a/tests/expected/bare_accesses.txt b/tests/expected/bare_accesses.txt new file mode 100644 index 0000000..4c14629 --- /dev/null +++ b/tests/expected/bare_accesses.txt @@ -0,0 +1,4 @@ +warning: accessing a memory region without using a variable (bare_accesses.s: line 22) +warning: accessing a memory region without a proper name ('whatever') (bare_accesses.s: line 23) +error: out of bounds memory access for 'zp_used' ($00-$01) (bare_accesses.s: line 27) +error: out of bounds memory access for 'zp_used' ($00-$01) (bare_accesses.s: line 28) -- cgit v1.2.3