dotgnu-pnet
[Top][All Lists]
Advanced

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

[Pnet-developers] [bugs #6123] Accesses to nested structs are compiled i


From: Rhys Weatherley
Subject: [Pnet-developers] [bugs #6123] Accesses to nested structs are compiled incorrectly
Date: Sat, 14 Feb 2004 19:55:58 -0500
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1) Gecko/20020826

This mail is an automated notification from the bugs tracker
 of the project: DotGNU Portable.NET.

/**************************************************************************/
[bugs #6123] Latest Modifications:

Changes by: 
                Rhys Weatherley <address@hidden>
'Date: 
                Sun 02/15/04 at 00:55 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
          Resolution | None                      | Fixed
              Status | Open                      | Closed


------------------ Additional Follow-up Comments ----------------------------
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.






/**************************************************************************/
[bugs #6123] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=6123>
Project: DotGNU Portable.NET
Submitted by: 0
On: Thu 10/23/03 at 13:22

Category:  None
Severity:  5 - Average
Item Group:  None
Resolution:  Fixed
Assigned to:  None
Status:  Closed


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. 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

Follow-up Comments
------------------


-------------------------------------------------------
Date: Sun 02/15/04 at 00:55         By: rweather
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.

-------------------------------------------------------
Date: Thu 10/23/03 at 13:51         By: None
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...)







File Attachments
-------------------

-------------------------------------------------------
Date: Thu 10/23/03 at 13:22  Name: test3.c  Size: 223KB   By: None
The test program
http://savannah.gnu.org/bugs/download.php?item_id=6123&amp;item_file_id=747






For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=6123>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/





reply via email to

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