dotgnu-pnet
[Top][All Lists]
Advanced

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

[Pnet-developers] [patch #3387] Fix for AssemblyBuilder.Save, fix WriteC


From: anonymous
Subject: [Pnet-developers] [patch #3387] Fix for AssemblyBuilder.Save, fix WriteClassToken to import class from external images
User-agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)

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




/**************************************************************************/
[patch #3387] Full Item Snapshot:

URL: <http://savannah.gnu.org/patch/?func=detailitem&item_id=3387>
Project: DotGNU Portable.NET
Submitted by: 0
On: Fri 09/24/04 at 07:02

Category:  None
Priority:  7 - High
Resolution:  None
Privacy:  Public
Assigned to:  None
Originator Email:  address@hidden
Status:  Open


Summary:  Fix for AssemblyBuilder.Save, fix WriteClassToken to import class 
from external images

Original Submission:  Bug Description:
When saving an assembly built using Reflection.Emit,
incorrect tokens for the parameters of methods called, e.g. with callvirt, are 
saved.
The tokens being saved, may only be valid in the image that calls 
AssemblyBuilder.Save. Classes not in the image being built must be imported.

To Reproduce:
create an assembly/module/type/method with System.Reflection.Emit. In the 
method, generate a callvirt
instruction for a method in the executing assembly that takes some class as a 
parameter, for example: call (System.Collections.IList args, bool evalargs)
The saved assembly will contain an invalid token for the IList class. If the 
token's value is invalid in the assembly, running ildasm on the assembly will 
produce something like this:
metadata error in token 0x0A000001: invalid MemberRef type signature
If the token's value is valid, then you will probably see a different class 
than IList in the IL output.

Fix:
These invalid tokens are written in image/sig_writer.c:WriteClassToken.
Here, calling ILClassImport creates a new token that is valid in the saved 
assembly.
Note: ILClassImport(class) does nothing but return its argument if the class is 
already in the image being built.





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

-------------------------------------------------------
Date: Fri 09/24/04 at 07:02  Name: sig_writer-importclass.diff  Size: 8.21KB   
By: None
patch for cvs 2004 9-23 pnet/image/sig_writer.c
http://savannah.gnu.org/patch/download.php?item_id=3387&amp;item_file_id=3698






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

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





reply via email to

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