bugDotGNU Portable.NET - Bugs: bug #6123, Accesses to nested structs are...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #6123: Accesses to nested structs are compiled incorrectly

Submitter:  None
Submitted:  Thu 23 Oct 2003 01:22:21 PM UTC
   
 
Category:  None Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed

Sun 15 Feb 2004 12:55:57 AM UTC, comment #2: 

While the suggested fix will address this particular
instance, there are many others where the wrong kind of
pointer will just "appear".  I've modified the verifier
to relax the M/T/I pointer conditions in "unsafe" mode.

Fix committed to CVS - 15 Feb 2004.

Rhys Weatherley <rweather>
Group administrator
Thu 23 Oct 2003 01:51:54 PM UTC, comment #1: 

The bug was traced to the c_lvalue.tc:291

-if(layout)
+if(layout && 0)

makes it generate 2 ldflda calls . This disables the
offset based optimisations (or reduces structs to the
standard object overhead). So a workaround solution has
been achieved. (...waits for real solution...)

Anonymous
Thu 23 Oct 2003 01:22:21 PM UTC, 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. it should be 2 field fetches ?

ie
ldflda valuetype 'struct Foo' 'struct Container'::'foo'
ldflda valuetype 'array int[10]' 'struct Foo'::'a'

This is currently breaking libjpeg

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #753:  test3.c added by None (223B - text/plain - The test program)

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

 

Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2004-02-15 rweather StatusNone Fixed
    Open/ClosedOpen Closed

Back to the top

Powered by Savane 3.13-aa77.
Corresponding source code