From: Robert A Duff <bobduff@world.std.com>
Subject: Re: Constraint checking of actuals passed to Attributes
Date: 2000/05/17
Date: 2000-05-17T00:00:00+00:00 [thread overview]
Message-ID: <wccitwd1fs2.fsf@world.std.com> (raw)
In-Reply-To: x7vpuqp2jpa.fsf@pogner.demon.co.uk
Simon Wright <simon@pogner.demon.co.uk> writes:
> Robert A Duff <bobduff@world.std.com> writes:
>
> > In the run-time model the AverStar compiler chooses, the compiler can
> > prove validity quite often. For example, an 'in' parameter of an
> > integer type is always valid, because it was constraint checked at the
> > call site.
>
> Presumably this isn't true if the subprogram was exported ..
You mean exported as in pragma Export? It's true even in that case.
Eg:
procedure P(X: Positive) is
S: String(1..10);
begin
S(X) := 'x';
end P;
Inside P, we assume X is in Positive. On the assignment, the generated
code will check that X <= 10, but will *not* check that X >= 1. If you
call P from C code, it's your responsibility to pass the correct stuff.
If you pass in a negative value, you will overwrite an arbitrary memory
location.
This is always true: you always lose all checking (compile time and run
time) at the interface between Ada and some foreign language.
- Bob
next prev parent reply other threads:[~2000-05-17 0:00 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-05 0:00 Constraint checking of actuals passed to Attributes Matt Brennan
2000-05-05 0:00 ` Keith Thompson
2000-05-08 0:00 ` Tucker Taft
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Ted Dennison
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Ted Dennison
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Ted Dennison
2000-05-09 0:00 ` Robert A Duff
2000-05-09 0:00 ` Robert A Duff
2000-05-09 0:00 ` Robert Dewar
2000-05-09 0:00 ` Robert A Duff
2000-05-09 0:00 ` Keith Thompson
2000-05-10 0:00 ` Robert A Duff
2000-05-14 0:00 ` Simon Wright
2000-05-17 0:00 ` Robert A Duff [this message]
2000-05-12 0:00 ` Tucker Taft
2000-05-12 0:00 ` Ted Dennison
2000-05-12 0:00 ` Robert A Duff
2000-05-12 0:00 ` Ted Dennison
2000-05-16 0:00 ` Robert A Duff
2000-05-16 0:00 ` Ted Dennison
2000-05-17 0:00 ` Robert Dewar
2000-05-10 0:00 ` Robert Dewar
2000-05-10 0:00 ` Robert A Duff
2000-05-15 0:00 ` Bill Greene
2000-05-10 0:00 ` David C. Hoos, Sr.
2000-05-22 0:00 ` Kenneth Almquist
2000-05-10 0:00 ` Matt Brennan
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox