Related Projects > NASMX

Subtle Bug (I think)


While reading through trying to learn nasm's preprocessor since it's godly, I was trying to invoke the %else in the below snippet:

--- Code: line 1248-1255

%iftoken %{2}_size
%assign %%__argsize %{2}_size
%if (%%__argsize < 1)
%fatal invalid size for %{$__nx_name}.%{1}: %{2}
%fatal unknown size for %{$__nx_name}.%{1}: %{2}

--- End code ---

I couldn't.  Everything I was throwing at this test was always returning true.

A sample of what I was trying:

--- Code: ---%include ''

 NASMX_RESERVE x, yadda, 1
 NASMX_RESERVE y, uint32_t, 1

--- End code ---

Now, it's possible that I'm simply doing it wrong, and quite frankly if it works, why should I care right?
It just bothers me that ${2}_size evaluates to a true value even when it isn't defined as a token as yadda_size for instance isn't defined.

Am I missing something?


[0] Message Index

Go to full version