Re: [BLACKBOX] Possible compiler bug ?

From: [at]} <Aubrey.McIntosh{>
Date: Mon, 19 Dec 2011 08:25:12 -0600


It compiles to completion in V4:
iOP2 RC/NM V1.7 22.1.1996
  compiling DemoMeter; new symbol file 58
And the user program traps at the expected place on the NIL pointer.

I think that the BlackBox compiler is a descendant of the original OP2 compiler. There is an early 90s paper that describes the internal data structures of OP2. Is it obvious to anyone how to walk down the source for the two compiler execution paths side by side to see what catches the eye?


On Mon, Dec 19, 2011 at 5:36 AM, Chris Burrows <chris{([at]})nowhere.xy


>-----Original Message-----
>From: BlackBox [mailto:BLACKBOX{([at]})nowhere.xy
>Sent: Sunday, 18 December 2011 8:05 PM
>To: BLACKBOX{([at]})nowhere.xy
>Subject: [BLACKBOX] Possible compiler bug ?
>

>Hi
>
>I can't compile the code below, which seems ok to me.
>
>I don't get an error message, I get a compiler crash.
>
>Am I overlooking something obvious?
>
>Regards
>
>Robert
>
>
>
>MODULE DemoMeter;
>
>
>TYPE
> Meter = POINTER TO RECORD
> maxVal : INTEGER;
> END;
>
>
>PROCEDURE Do*;
> VAR
> pos, val : INTEGER;
> meter : Meter;
> BEGIN
> pos := SHORT (val * LONG (100) DIV meter.maxVal)
> END Do;
>
>
>END DemoMeter.
>


Curiouser and curiouser ...

Your code crashes the Gardens Point .NET compiler as well. However, quite
unexpectedly to me, the GPCP version *compiles* OK when meter is initialised
with NEW. val also has to be initialised when using GPCP.

If you are looking for a workaround in BlackBox while waiting for the
problem to be fixed, the usual solution in cases such as this is to break
the expression up into simpler parts e.g. the following compiles where
maxVal is a local INTEGER variable:

 maxVal := meter.maxVal;
 pos := SHORT (val * LONG (100) DIV maxVal)

Regards,
Chris

Chris Burrows
CFB Software
http://www.cfbsoftware.com/gpcp



----
To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy-- 
Aubrey McIntosh, Ph.D.
1502 Devon Circle
Austin TX 78723-1814
http://home.grandecom.net/~amcintosh/aubrey/Search/
---- To unsubscribe, send a message with body "SIGNOFF BLACKBOX" to LISTSERV{([at]})nowhere.xy
Received on Mon Dec 19 2011 - 15:25:12 UTC

This archive was generated by hypermail 2.3.0 : Thu Sep 26 2013 - 06:30:09 UTC