Unfortunatelly this problem still appears, so I have a question: what to call/set, to notify the assembler that size of code has changed, and it should add one more pass?
I have two macros called by my custom made %proc and %endprc directives. The code for %proc directive uses two passes:
Pass 1: collect the size of all local variables. This is done by code handler for build-in %local directive.
Pass 2-* can generate the proper epilogue, but:
%macro PROC32_MACRO_NAME 5-*
%if use_ebp_frame
%if not_naked
... push ebp/mov ebp,esp
%if size_of_locals>0 ; <-- here
sub esp, size_of_locals
%endif
In the first pass, size_of_locals is zero, so %proc handler puts zero to PROC32_MACRO_NAME macro and "sub esp" is not generated.
While processing %local directives in first pass, size_of_locals is updated dynamically.
In the second, size_of_locals is already known, and will be not adjusted by %local directives. If size_of_locals is not zero, the size of code generated by PROC32_MACRO_NAME macro will change.
If size of code is changes, other macros (if, while) are losing local labels, and nasm quits with undefined symbol ..@ error.