Author Topic: Recursive Macros and Beyond!  (Read 47499 times)

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: Recursive Macros and Beyond!
« Reply #15 on: September 07, 2010, 07:09:52 PM »
I'll address Rob's "bug report" as soon as I can, give the rewrite some more time to marinate, and then start wrapping-up the loose ends so that it is production ready.

Thanks, Keith.  I did not feel the need to add to bug tracker as you were still coding, but rather simply providing a heads up.  ;)

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Recursive Macros and Beyond!
« Reply #16 on: September 07, 2010, 07:26:02 PM »
Thanks, Keith.  I did not feel the need to add to bug tracker as you were still coding, but rather simply providing a heads up.  ;)

Yep, that's why I quoted "bug report" as it wasn't official, but still a high priority.

Thanks. -Keith

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Recursive Macros and Beyond!
« Reply #17 on: October 02, 2010, 12:52:43 AM »
Today I happened to retest the NASMX demos using preproc-rewrite and I found what I think is a bug.
At first I thought the bug manifest itself because of multiple dots (ie: MSG.pt.x) in a define.  Then I set out to create a test case for that - the result of which proved nothing (at least not visibly).

The issue appears in relation to macro local variables. Specifically, it appears to be occurring when %assign'ing an equ'ated offset or size (using multiple dotted defnames) to a local variable which is then given to the times macro. You can see this in action in NASMX_AT or NASMX_ENDSTRUC. Try compiling demos 2 and 3 to see this behaviour as these demos both contain the MSG.pt nested structure.

The version of preproc-rewrite I used for testing is
Code: [Select]
nasm -v
NASM version 2.10rc1 compiled on Aug  9 2010
datestamped 8/9/2010 10:48pm

All current NASMX demos compile fine on Nasmv2.09rc6 and execute correctly.
Perhaps something jiggled loose?

Rob, do you have an updated or more concise demonstration of the issue... specifically one that is compliant with local-context fall-through deprecation?

Offline Keith Kanios

  • Full Member
  • **
  • Posts: 383
  • Country: us
    • Personal Homepage
Re: Recursive Macros and Beyond!
« Reply #18 on: October 02, 2010, 01:08:04 AM »
Testing whether it works, I used the wrong order first and found a problem that occurs anywhere (not just in %final): an %endif directive without a matching %if correctly displays the NASM error about this condition, but segfaults afterwards.

I've pushed a change that fixes the segfault issue with %endif.

Offline Rob Neff

  • Forum Moderator
  • Full Member
  • *****
  • Posts: 429
  • Country: us
Re: Recursive Macros and Beyond!
« Reply #19 on: October 02, 2010, 03:34:38 PM »
Rob, do you have an updated or more concise demonstration of the issue... specifically one that is compliant with local-context fall-through deprecation?

Unfortunately the current state is not yet stabilized enough and quite a few changes have occurred since the last report that I'm currently unable to provide what you request.  However, I have already fixed the context-fall-through issue and will be revisiting the local macro variable issue again soon - testing against Nasm v2.10rc's - so look to hear back from me  ;D