Menu

#98 macro expansion bug (infinite loop)

OnBoard_C
open-fixed
OnBoard C (33)
5
2008-07-16
2008-07-15
No

I wrote this innocuous-looking code...

UInt32 ref;
UInt32 time;
// set ref and time
AlmSetProcAlarm(MyFunc, ref, time);

This causes a hang. It turns out it's an infinite loop.

The problem is that the AlmSetProcAlarm macro uses 'ref' as the second argument. There is a check in the code to handle 'recursive' arguments like this but since I put a space after the comma, this code was foiled.

I have a work around for this (skip over any white space before doing the recursive check) that seems to work fine (both in POSE and onboard).

I've put up a binary for testing at the usual location.
http://ramsay.webhop.org/OnBoard.zip

Discussion

  • Nobody/Anonymous

    Logged In: NO

    The fix for this bug does not fix bug 652833. It looks similar though, certainly the same area in the code so I'll take a look at it too (since I'm now kind-of familiar with the macro code).

     
  • Lincoln Ramsay

    Lincoln Ramsay - 2008-07-16

    Logged In: YES
    user_id=736434
    Originator: YES

    This has been fixed in CVS.

     
  • Lincoln Ramsay

    Lincoln Ramsay - 2008-07-16
    • labels: --> OnBoard C
    • milestone: --> OnBoard_C
    • assigned_to: nobody --> a1291762
    • status: open --> open-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB