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) |
[1 later articles] |
From: | "Joachim Durchholz" <joachim.durchholz@halstenbach.com.or.de> |
Newsgroups: | comp.compilers |
Date: | 6 Mar 2000 00:19:58 -0500 |
Organization: | Compilers Central |
References: | 00-02-138 |
Keywords: | design |
Floris 'Tamama' van Gog <floris@vangog.net> wrote:
>
> I'm still working on my little C-hybrid for a little VM im making. The
> language is extended in that it can use 'external' variables. These
> are actually handles, but are in the language accessed through a
> pointer of some sort.
>
> [...]
>
> Now, the way I pictured this still allows some unsafe constructs, as
> in that one can use a local pointer (VM space) and change that to
> point to the external pointer, then change it, and chrash the VM. I
> could disallow pointer-changing for all pointers, but they are so
> handy :-)
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).
Regards,
Joachim
Return to the
comp.compilers page.
Search the
comp.compilers archives again.