From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=0.8 required=3.0 tests=BAYES_50 autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 23 Jul 93 05:06:02 GMT From: munnari.oz.au!comp.vuw.ac.nz!canterbury.ac.nz!news!otago.ac.nz!simon@uune t.uu.net (The Arch-Deviant) Subject: Bug in VMS Ada 3.0? Message-ID: <1993Jul23.180602.1@otago.ac.nz> List-Id: (This was asked a while ago but didn't receive any response. I'm trying again on the grounds that (a) if it is a bug it seems quite a biggie and (b) I'm looking forwards to hitting DEC with a problem report if I can :-) ) VMS Ada 3.0 appears not to perform range-checking when separate subunits make use of global variables. Consider the following example: procedure Foo is subtype I_Range is integer range 1..10; A: array( I_Range ) of integer; I: I_Range; procedure Bar is separate; begin Bar; -- Bar contains something like "A(I) := 0" end Foo; The compiler does not generate any range-checking code in Bar, so that proc will blindly write to whatever random memory location the unitialised index I happens to point to, even if it is outside I_Range. If Bar is in the same file then CONSTRAINT_ERROR will be raised as expected. My understanding was that the program should perform equivalently regardless of which subunits are in separate files. Am I missing something or have DEC made a mistake? (And if the latter how the heck did this get past certification?) Thanks... Simon Brady "So go ahead, put us down University of Otago The time will come when we turn it around Dunedin, New Zealand Won't be long, mark my words The time will come for revenge of the nerds!"