Related articles |
---|
Language design/VM design floris@vangog.net (Floris 'Tamama' van Gog) (2000-02-27) |
Re: Language design/VM design joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-03-06) |
Re: Language design/VM design jeremy@jboden.demon.co.uk (Jeremy Boden) (2000-03-06) |
Re: Language design/VM design floris@vangog.net (Floris 'Tamama' van Gog) (2000-03-11) |
Re: Language design/VM design jeremy@jboden.demon.co.uk (Jeremy Boden) (2000-03-23) |
Re: Language design/VM design alanf@ns.net (Alan Fargusson) (2000-03-23) |
Re: Language design/VM design joachim.durchholz@halstenbach.com.or.de (Joachim Durchholz) (2000-03-23) |
Re: Language design/VM design floris@vangog.net (Floris 'Tamama' van Gog) (2000-03-28) |
Re: Language design/VM design stephan@pcrm.win.tue.nl (2000-04-01) |
From: | Jeremy Boden <jeremy@jboden.demon.co.uk> |
Newsgroups: | comp.compilers |
Date: | 6 Mar 2000 23:49:00 -0500 |
Organization: | Compilers Central |
References: | 00-02-138 00-03-008 |
Keywords: | architecture, types |
Joachim Durchholz <joachim.durchholz@halstenbach.com.or.de> writes
...
>I assume you mean a type cast with "change" in the above. In that
>case, if you want pointer arithmetic and external/internal pointers,
>disallow casts between internal and external pointers.
>
>The AS/400 has exactly the same problem: they have C on a machine with
>external pointers to operating system objects. They have a tougher
>problem in that they have full ANSI C, so they cannot disallow type
>casts.
>I haven't looked too deeply into it, but I recall that the system checks
>that an external pointer is valid before dereferencing it. They may even
>have added a cryptrographic checksum to the pointer to prevent tampering
>(the AS/400 is paranoid enough about security to have such a thing, and
>external pointers are large enough, 60 bytes or more IIRC - I guess they
>include references to a user profile to allow access permission
>checking).
All AS/400 pointers are actually 8 bytes (128 bits); basically 64 bits
points to a machine space or object and the other 64 bits as the space
offset. This is true regardless of whether a pointer is to an "internal"
or "external" address. I believe there *could* also be some limited
checking to ensure that the 8 byte field is a pointer.
The AS/400 will check that a pointer is valid and that it references an
object to which you have access. Actually I have always wondered how
void casts are done, since the machine can't check what kind of object
is being accessed via the void pointer.
--
Jeremy Boden
Return to the
comp.compilers page.
Search the
comp.compilers archives again.