From abaffa61df7db8522d29869f7c455c59b8e96dbc Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Tue, 10 Mar 2026 00:14:33 +0100 Subject: Re-create the values for bundle call arguments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bundle call arguments were fine most of the times, when arguments could be processed as-is and there were no issues with arguments being overwritten by successive calls. This was not the case, though, whenever a given instruction was delayed into a PendingNode status. In this case, the argument would get the last value, and in some extreme cases that definition might not have been there any more. Prevent all of this by providing a list of PendingDefine's, which are a way to re-create these call-only arguments as they were initially found. These PendingDefine's are then created on "crunch" on each PendingNode. Signed-off-by: Miquel Sabaté Solà --- scripts/test-e2e.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts/test-e2e.sh') diff --git a/scripts/test-e2e.sh b/scripts/test-e2e.sh index 02d1ca3..ddb7b0a 100755 --- a/scripts/test-e2e.sh +++ b/scripts/test-e2e.sh @@ -102,6 +102,13 @@ exit_code=$((exit_code + $?)) diff tests/out/indirect.nes tests/expected/indirect.nes exit_code=$((exit_code + $?)) +echo "test: custom => delayed_macro_arguments.nes" +./target/debug/nasm -c empty --asan tests/delayed_macro_arguments.s -o tests/out/delayed_macro_arguments.nes 2>tests/out/delayed_macro_arguments.txt +diff tests/out/delayed_macro_arguments.txt tests/expected/delayed_macro_arguments.txt +exit_code=$((exit_code + $?)) +diff tests/out/delayed_macro_arguments.nes tests/expected/delayed_macro_arguments.nes +exit_code=$((exit_code + $?)) + ## # code.nes -- cgit v1.2.3