[Nasm-bugs] [Bug 3392722] New: Defining a local definition with %define with macro args no longer works

noreply-nasm at dev.nasm.us noreply-nasm at dev.nasm.us
Fri Nov 13 18:24:20 PST 2020


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

            Bug ID: 3392722
           Summary: Defining a local definition with %define with macro
                    args no longer works
           Product: NASM
           Version: 2.15.xx
          Hardware: Macintosh
                OS: Mac OS
            Status: OPEN
          Severity: normal
          Priority: Medium
         Component: Assembler
          Assignee: nobody at nasm.us
          Reporter: uyjulian 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

Defining a local definition with %define with macro args no longer works on or
after NASM 2.15rc1:

%define %$%1 %2

Doing the same thing with NASM 2.14.03rc2 works successfully.

With command line "nasm  -fwin32 -DWIN32 min.nas -oout.o"
Here is a minimized test case (as min.nas):

%imacro globaldef 1
        %define %1 _%1
        global %1
%endmacro


%define segment_code segment .text
%macro function_align 0
                segment_code
                align 4
%endmacro


%macro  proc_start      1
        %push   %1
                function_align
%1:
                %define         %$stack_restore
                %assign         %$arg_base              28
                %assign         %$var_base              4
                push            edi
                push            esi
                push            ebx
                push            ecx
                push            edx
                push            ebp
                mov                     ebp,                    esp
%endmacro


%macro  proc_name_def 2
; VVV ISSUE
                %define %$%1 %2
; ^^^ ISSUE
%endmacro


%macro  proc_arg        2
                proc_name_def   %2,             ebp+%$arg_base
                %assign         %$arg_base              %$arg_base+%1
%endmacro


globaldef               test_func

        function_align
proc_start      test_func
        proc_arg        4,      test_arg

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