[Mono-devel-list] Mono and verifiable code

Paolo Molaro lupus at ximian.com
Tue Oct 21 08:11:01 EDT 2003


On 10/21/03 Jonathan Pryor wrote:
> Fields can overlap with explicit layout.  It's a feature!  (How else are
> you supposed to declare a "C" union without having union support in the
> language?  It's easy with explicit layout -- set all union members to
> have the same offset.)
> 
> This is even supported on .NET.

What the poster meant is the overlapping of a reference type with a
non-reference: it's not allowed (or you couldn't implement a precise or
moving GC and it would be trivial to make the runtime execute unsafe
code even).

> On Tue, 2003-10-21 at 07:03, Alain.Frisch at ens.fr wrote:
> > Looking at verify.c, it seems that Mono does not check anything about
> > overlapping of fields with explicit layout. Indeed, I can produce C# code
> > that overlap an integer and a reference type, and it is accepted by the
> > loader and pedump --verify all.

Only some of the verification checks are done: help is welcome
completing all the needed checks.

lupus

-- 
-----------------------------------------------------------------
lupus at debian.org                                     debian/rules
lupus at ximian.com                             Monkeys do it better



More information about the Mono-devel-list mailing list