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

Submitted by:  None
Submitted on:  Thu 23 Oct 2003 01:22:21 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Fixed
Privacy: PublicAssigned 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>
Project 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

 

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

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Sun 15 Feb 2004 12:55:57 AM UTCrweatherStatusNone=>Fixed
  Open/ClosedOpen=>Closed

Back to the top


Powered by Savane 3.1-cleanup1