[Nasm-bugs] [Bug 3392652] New: NASM 2.15 hangs when processing single-line macros

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Wed Mar 11 04:55:24 PDT 2020


https://bugzilla.nasm.us/show_bug.cgi?id=3392652

            Bug ID: 3392652
           Summary: NASM 2.15 hangs when processing single-line macros
           Product: NASM
           Version: 2.15 (development)
          Hardware: All
                OS: All
            Status: OPEN
          Severity: major
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: andrey.matyukov at gmail.com
                CC: chang.seok.bae at intel.com, gorcunov at gmail.com,
                    hpa at zytor.com, nasm-bugs at nasm.us
     Obtained from: Binary from nasm.us

As of NASM 2.15 the invocation of single-line macros accepting several
arguments with some empty parameter leads to unexpected hangs without any
diagnostics.
NASM 2.14 eats it without any problem.

```
%define MKGLOBAL(name,type,scope) global name %+ : %+ type scope
MKGLOBAL(precomp,function,)
```


The second issue (minor) is in arguments parser - in the constructions like
below, the inner macro parameters are counted as parameters of outer macro, so
the MKGLOBAL macro below is treated as the macro of 4 arguments, instead of 3.
(Not sure it is worth to fix it as it is possible to workaround it using curly
braces around inner macro).

```
%define MKGLOBAL(name,type,scope) global name
%define FN_NAME(x,y) aes_gcm_ %+ x %+ _128 %+ y %+ vaes_avx512


MKGLOBAL(FN_NAME(precomp,_),function,)
```

% nasm test.nasm
test.nasm:5: warning: single-line macro `MKGLOBAL' exists, but not taking 4
parameters [-w+macro-params-single]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are watching all bug changes.


More information about the Nasm-bugs mailing list