A trailing comma indicates that the final
parameter of a multi-line macro is empty.
As of filing this bug report, NASM 0.98.38
does not implement this behavior. Instead
it fails to establish the proper count. It
also fails to allocate the empty parameter.
As a result the preprocessor may invoke an
undesired multi-line macro.
Attached find the the changes required to
fix this bug, as well as some testcases.
Logged In: YES
user_id=804543
The proposed fix for SF bug #1284169 affects the
proposed changes previously attached here.
I looked at the test file, but I can't figure out what the intent is, or what the supposed bug is supposed to be.
If you assemble the attached .asm file in
preprocess-only mode, you should get this:
(The comments indicate where NASM -- as of
yesterday's tree -- gets it wrong.)
--- empty testcases ---
0 nparam=0 () () () ()
1 nparam=1 () () () () ; NASM: nparam=0
---
2 nparam=2 () () () () ; NASM: 1 nparam=1
2 nparam=2 () () () () ; NASM: 1 nparam=1
2 nparam=2 () () () () ; NASM: 1 nparam=1
2 nparam=2 () () () () ; NASM: 1 nparam=1
---
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () () () ; NASM: 2 nparam=2
--- non-empty testcases ---
0 nparam=0 () () () ()
1 nparam=1 (x) () () ()
---
2 nparam=2 () () () () ; NASM: 1 nparam=1
2 nparam=2 () (b) () ()
2 nparam=2 (a) () () () ; NASM: 1 nparam=1
2 nparam=2 (a) (b) () ()
---
3 nparam=3 () () () () ; NASM: 2 nparam=2
3 nparam=3 () () (z) ()
3 nparam=3 () (y) () () ; NASM: 2 nparam=2
3 nparam=3 () (y) (z) ()
3 nparam=3 (x) () () () ; NASM: 2 nparam=2
3 nparam=3 (x) () (z) ()
3 nparam=3 (x) (y) () () ; NASM: 2 nparam=2
3 nparam=3 (x) (y) (z) ()
--- braced testcases ---
1 nparam=1 () () () ()
1 nparam=1 (x) () () ()
---
2 nparam=2 () () () ()
2 nparam=2 () (b) () ()
2 nparam=2 (a) () () ()
2 nparam=2 (a) (b) () ()
---
3 nparam=3 () () () ()
3 nparam=3 () () (z) ()
3 nparam=3 () (y) () ()
3 nparam=3 () (y) (z) ()
3 nparam=3 (x) () () ()
3 nparam=3 (x) () (z) ()
3 nparam=3 (x) (y) () ()
3 nparam=3 (x) (y) (z) ()
---