[Nasm-bugs] [Bug 3392543] Pain with %arg names in macro expansions

noreply-nasm at gorcunov.org noreply-nasm at gorcunov.org
Sun Dec 30 12:35:37 PST 2018


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

James Harris <james.harris.1 at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |james.harris.1 at gmail.com

--- Comment #1 from James Harris <james.harris.1 at gmail.com> ---
The original macros.

;******************************************************************************
;
; proc ... endproc
;
;******************************************************************************

%macro proc 1-*
  %ifctx proc
    %error "Already in a 'proc' context"
  %endif
  %push proc
  %define _._procname %1
_._procname:
  %stacksize flat
  %assign %$localsize 0
  %rep %0 - 1
    %rotate 1
    %arg %1:dword
  %endrep
  push ebp
  mov ebp, esp
  push edi
  push esi
  push edx
  push ecx
  push ebx
%endmacro


%macro endproc 0
  %ifnctx proc
    %error "Not in 'proc' context"
  %endif
_._procname %+ .done:
  pop ebx
  pop ecx
  pop edx
  pop esi
  pop edi
  pop ebp
  ret
  %pop proc
%endmacro


Invocations which lead to failures

proc char_write, stream, ch
proc string_write, stream, stringp
proc natural_write, stream, number
proc integer_write, stream, number

In those, Nasm seems to have problems with 'streams' and 'number' because they
are used more than once.

(This is just to show what the intention was. Will post a simpler, more
complete case which can be used to replicate the problem)

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


More information about the Nasm-bugs mailing list