From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e8c8d1c63ffacf0d X-Google-Attributes: gid103376,public From: Ted Dennison Subject: Re: Constraint checking of actuals passed to Attributes Date: 2000/05/12 Message-ID: <8fhnnj$ltd$1@nnrp1.deja.com>#1/1 X-Deja-AN: 622675997 References: <391250A8.99D1585C@hotmail.com> <39171B69.2F983487@averstar.com> <8f93lm$1es$1@nnrp1.deja.com> <8f9snr$vbr$1@nnrp1.deja.com> <391C543F.83B2A408@averstar.com> X-Http-Proxy: 1.0 x36.deja.com:80 (Squid/1.1.22) for client 204.48.27.130 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri May 12 19:57:49 2000 GMT X-MyDeja-Info: XMYDJUIDtedennison Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.7 [en] (WinNT; I) Date: 2000-05-12T00:00:00+00:00 List-Id: In article <391C543F.83B2A408@averstar.com>, Tucker Taft wrote: versus "abnormal" distinction. Imagine the following: > > Y : Very_Long_Integer range -5..5 := 4; > ... > Y := -5; -- imagine abort or other "disruption" happens in middle > -- of this multi-word assignment, and Y ends up with a weird value > -- like -4 billion (due to setting the high 32 bits to -1, > -- while leaving the low 32 bits as +4). > -- If then in finalization code or an exception handler > -- we write "A(Y) := 36". Y might be abnormal and the > -- implementation is free to trash random memory. > > In other words, abnormal means out of range due to disruption, or > "bad" binary input or unchecked conversion, > whereas invalid means out of range due to lack of initialization or > other "normal" behavior. The implementation is supposed to "survive" Thanks for the explanation. That distinction was exactly what I was wondering about. But I still don't understand the logic behind making misuse of an overlay an "invalid" case rather than an "abonormal" (and thus erronious) case. Couldn't it cause the same -4 billion value to get placed into Y? The compiler would have no easy way to detect that the state has changed to "invalid". How do you enforce that the program "survives" this? -- T.E.D. http://www.telepath.com/~dennison/Ted/TED.html Sent via Deja.com http://www.deja.com/ Before you buy.