[Mono-bugs] [Bug 70153][Nor] New - Failure to encode field constants with byte arrays.

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Thu, 2 Dec 2004 15:49:24 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by miguel@ximian.com.

http://bugzilla.ximian.com/show_bug.cgi?id=70153

--- shadow/70153	2004-12-02 15:49:24.000000000 -0500
+++ shadow/70153.tmp.16523	2004-12-02 15:49:24.000000000 -0500
@@ -0,0 +1,76 @@
+Bug#: 70153
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: IL assembler
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: miguel@ximian.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Failure to encode field constants with byte arrays.
+
+The following IL source code crashes PEAPI:
+
+//  Microsoft (R) .NET Framework IL Disassembler.  Version 2.0.40607.16
+//  Copyright (C) Microsoft Corporation. All rights reserved.
+
+
+
+// Metadata version: v1.1.4322
+.assembly extern mscorlib
+{
+  .publickeytoken = (B7 7A 5C 56 19 34 E0 89 )                         //
+.z\V.4..
+  .ver 1:0:5000:0
+}
+.assembly a
+{
+  .hash algorithm 0x00008004
+  .ver 0:0:0:0
+}
+.module a.exe
+.imagebase 0x00400000
+.file alignment 0x00000200
+.subsystem 0x0003       // WINDOWS_CUI
+.corflags 0x00000001    //  ILONLY
+.namespace Mono.CSharp
+{
+  .class public auto ansi abstract TypeContainer
+        extends System.Object
+        implements Mono.CSharp.IMemberContainer  {
+    .field public static  literal   string DefaultIndexerName = bytearray (
+        49 00 74 00 65 00 6d 00 )                        // I.t.e.m.
+}
+}
+
+I get this stack trace:
+
+mono$ ilasm a.il
+Assembling 'a.il' , no listing file, to exe --> 'a.exe'
+
+Name is: Mono.CSharp.IMemberContainer
+Reference to undefined class 'Mono.CSharp.IMemberContainer'
+I am a PEAPI.ByteArrConst
+
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x0002c> PEAPI.Constant:GetTypeIndex ()
+in <0x0001a> PEAPI.ConstantElem:Write (PEAPI.FileImage)
+in <0x001f0> PEAPI.MetaData:WriteTildeStream (PEAPI.FileImage)
+in <0x00176> PEAPI.MetaData:WriteMetaData (PEAPI.FileImage)
+in <0x000d1> PEAPI.FileImage:WriteTextSection ()
+in <0x00010> PEAPI.FileImage:WriteSections ()
+in <0x00081> PEAPI.FileImage:MakeFile ()
+in <0x00010> PEAPI.PEFile:WritePEFile ()
+in <0x007af> Mono.ILASM.CodeGen:Write ()
+
+(Debugging messages are to track it down).
+
+The Constant is of type ByteArrConst