dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pnet-developers] [bug #6123] Accesses to nested structs are compile


From: Fergus Henderson
Subject: Re: [Pnet-developers] [bug #6123] Accesses to nested structs are compiled incorrectly
Date: Fri, 24 Oct 2003 13:25:33 +1000
User-agent: Mutt/1.3.28i

On 23-Oct-2003, address@hidden <address@hidden> wrote:
> =================== BUG #6123: FULL BUG SNAPSHOT ===================
> http://savannah.gnu.org/bugs/?func=detailbug&bug_id=6123&group_id=353
> 
> Submitted by: None                    Project: DotGNU Portable.NET          
> Submitted on: Thu 10/23/2003 at 09:22
> Category:  None                       Severity:  5 - Major                  
> Bug Group:  None                      Resolution:  None                     
> Assigned to:  None                    Status:  Open                         
> 
> Summary:  Accesses to nested structs are compiled incorrectly
> 
> Original Submission:  In a case where 
> 
> struct Foo { int a[10]; }
> struct Bar { struct Foo foo; }
> 
> struct Bar bar;
> int a=bar.foo.a[0];
> 
> would do 
> 
>       .locals init    (valuetype 'struct container', int32)
>       ldloca.s        0
>       ldflda  valuetype 'array int[10]' 'struct Foo'::'a'
>       ldind.i4
>       stloc.1
> 
> Which is wrong. 

Are you sure? 

Provided that valuetype 'struct Bar' is defined with explicit layout,
so that the "foo" field is guaranteed to be at offset zero, then
this code looks OK to me.

Which part of the ECMA spec do you think it violates?

> it should be 2 field fetches ?

Why?

> This is currently breaking libjpeg

What's the symptom?

Perhaps the problem is a bug in the JIT, rather than the compiler.

-- 
Fergus Henderson <address@hidden>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]