Posting here for folks that don't subscribe to bug tracker:
As an addendum to this issue: if the construct %{} is replaced with %[] then we get the desired results.
When comparing the Nasm documented uses of %{} to %[]...
4.3.8 Concatenating Macro Parameters: "This concatenation can also be applied to other preprocessor in-line objects, such as macro-local labels (section 4.3.2) and context-local labels (section 4.7.2)."
4.1.3 Macro Indirection: %[...]: "%[...] concatenates to adjacent tokens in the same way that multi-line macro parameters do"
So why are there differences? From my perspective they are actually both the same and probably should be using the exact same code. It theoretically makes no difference to either %[] or %{} with regard to expansion of single-line macros, macro parameters, macro local variables, or context variables. Why there are, in fact, two documented ways to perform the same task I'm not entirely sure except that currently %[] appears to work and %{} does not ( using Nasm v2.09x ).
I would like to see some consistency regarding this behavior such that:
%[] always does the immediate macro expansion and makes the %define available immediately to code following it's original point of definition (as is currently done).
%{} either does the exact same thing (which is kind of pointless as we already have %[] ) or is clearly marked for macro parameter expansion only ( %{1}, %{2}, etc ). Although that would probably break other apps that relied on the %{%foo}bar examples in the docs, so maybe not a good idea.
I've been slugging through this issue (macro expansion/indirection) over several iterations of Nasm and hope that this can be put to rest soon. Thank you all for your time and effort.