Re: [BLACKBOX] Possible compiler bug ?

From: [at]} <Chris>
Date: Mon, 19 Dec 2011 22:06:40 +1030

----boundary-LibPST-iamunique-1808733278_-_-
Content-type: text/plain

>-----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----boundary-LibPST-iamunique-1808733278_-_-
Content-type: application/rtf
Content-transfer-encoding: base64
Content-Disposition: attachment; filename="rtf-body.rtf"
e1xydGYxXGFuc2lcYW5zaWNwZzEyNTJcZnJvbXRleHQgXGRlZmYwe1xmb250dGJsDQp7XGYwXGZz
d2lzcyBBcmlhbDt9DQp7XGYxXGZtb2Rlcm4gQ291cmllciBOZXc7fQ0Ke1xmMlxmbmlsXGZjaGFy
c2V0MiBTeW1ib2w7fQ0Ke1xmM1xmbW9kZXJ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Oj0gbWV0ZXIubWF4VmFsO1xwYXINCiAgcG9zICA6PSAgU0hPUlQgKHZh
bCAqIExPTkcgKDEwMCkgRElWIG1heFZhbClccGFyDQpccGFyDQpSZWdhcmRzLFxwYXINCkNocmlz
XHBhcg0KXHBhcg0KQ2hyaXMgQnVycm93c1xwYXINCkNGQiBTb2Z0d2FyZVxwYXINCmh0dHA6Ly93
d3cuY2Zic29mdHdhcmUuY29tL2dwY3BccGFyDQpccGFyDQpccGFyDQotLS0tXHBhcg0KVG8gdW5z
dWJzY3JpYmUsIHNlbmQgYSBtZXNzYWdlIHdpdGggYm9keSAiU0lHTk9GRiBCTEFDS0JPWCIgdG8g
TElTVFNFUlZATElTVFMuT0JFUk9OLkNIXH19AE1jSQ==
----boundary-LibPST-iamunique-1808733278_-_---
Received on Mon Dec 19 2011 - 12:36:40 UTC

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