[nem-bug] [Nemerle 0000701]: [0.9.3] Empty structs have
$PLACE_HOLDER$ field
feedback at nemerle.org
feedback at nemerle.org
Sun Jul 2 12:56:20 CEST 2006
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=701>
======================================================================
Reported By: Snaury
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 701
Category: Compiler
Reproducibility: always
Severity: feature
Priority: normal
Status: new
======================================================================
Date Submitted: 07-01-2006 16:05 CEST
Last Modified: 07-02-2006 12:56 CEST
======================================================================
Summary: [0.9.3] Empty structs have $PLACE_HOLDER$ field
Description:
The following code:
public struct EmptyStruct { }
produces empty structure with the following IL:
.class public sequential ansi sealed beforefieldinit EmptyStruct
extends [mscorlib]System.ValueType
{
.pack 0
.size 1
} // end of class EmptyStruct
Nemerle's generated structure has no the following IL:
.class public auto ansi sealed EmptyStruct
extends [mscorlib]System.ValueType
{
.field private specialname uint8 $PLACE_HOLDER$
} // end of class EmptyStruct
As you can see, they differ and Nemerle's IL has strange $PLACE_HOLDER$
field. If possible, it would be good if generated code would be without
this $PLACE_HOLDER$ field...
======================================================================
----------------------------------------------------------------------
nazgul - 07-01-06 21:26
----------------------------------------------------------------------
AFAIR as added this field to mimick the C# compiler. But maybe has changed
after .NET 1.1 or it was mono compiler's behaviour. It must be checked if
this is still needed.
----------------------------------------------------------------------
nazgul - 07-02-06 12:56
----------------------------------------------------------------------
After using a patch I get verification error for empty structs:
bash-3.00$ ../../tools/verify out.exe
Microsoft (R) .NET Framework PE Verifier. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.
[MD]: Error: ClassLayout has parent TypeDef token=0x02000002 marked
AutoLayout. [token:0x00000001]
1 Error Verifying out.exe
I'm investigating the possible fix.
Issue History
Date Modified Username Field Change
======================================================================
07-01-06 16:05 Snaury New Issue
07-01-06 20:30 Snaury File Added: bug-placeholder.patch
07-01-06 21:26 nazgul Note Added: 0001331
07-02-06 12:56 nazgul Note Added: 0001334
======================================================================
More information about the bugs
mailing list