Menu

#158 trailing comma leads to wrong multi-line macro param count

open-works-for-me
nobody
None
4
2008-10-07
2004-01-07
No

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.

Discussion

  • nasm64developer

    nasm64developer - 2004-01-07
     
  • nasm64developer

    nasm64developer - 2004-01-07
     
  • nasm64developer

    nasm64developer - 2004-01-07
    • priority: 5 --> 1
    • status: open --> open-works-for-me
     
  • nasm64developer

    nasm64developer - 2005-09-29

    Logged In: YES
    user_id=804543

    The proposed fix for SF bug #1284169 affects the
    proposed changes previously attached here.

     
  • H. Peter Anvin

    H. Peter Anvin - 2008-07-20
    • priority: 1 --> 7
     
  • H. Peter Anvin

    H. Peter Anvin - 2008-10-07

    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.

     
  • H. Peter Anvin

    H. Peter Anvin - 2008-10-07
    • priority: 7 --> 4
     
  • nasm64developer

    nasm64developer - 2008-10-08

    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) ()
    ---

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.