Hi,

I've fixed the persistent Nasal/IRIX bug in CVS. It turned out to be the PUSH(r) macro in code.c:

# define PUSH(r) do { \
    if(ctx->opTop >= MAX_STACK_DEPTH) ERR(ctx, "stack overflow"); \
    ctx->opStack[ctx->opTop++] = r; \
    } while(0)

changing it to the following resulted in a working version for IRIX:

# define PUSH(r)  _PUSH((ctx), (r))
void _PUSH(struct Context* ctx, naRef r) {
   if(ctx->opTop >= MAX_STACK_DEPTH) ERR(ctx, "stack overflow");
    ctx->opStack[ctx->opTop++] = r;
}

At first I thought maybe the 'do {...} while(0)' section was optimized away (a bug in the compiler) but changing it to just '{...}' didn't work either.

The only thing I can think of right now is that inside the function the code is working with a *copy* of r

I'm puzzled.

Erik


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to