[m-dev.] IL grade broken

Peter Ross pro at missioncriticalit.com
Wed Dec 3 19:27:53 AEDT 2003


On Wed, Dec 03, 2003 at 11:21:03AM +1100, Fergus Henderson wrote:
> On 02-Dec-2003, Peter Ross <pro at missioncriticalit.com> wrote:
> > What is happening is that in mer_std.il for example we are generating
> > the following code
> > 
> > .method private static default
> >         bool
> >         'special___Unify___array_1_0'(
> >                 object[] 'TypeInfo_for_T_3',
> >                 class ['mscorlib']'System'.'Array' 'HeadVar__1_1',
> >                 class ['mscorlib']'System'.'Array' 'HeadVar__2_2'
> >         )
> > {
> > .maxstack 3
> > 
> >         .line 7 'array.int2'
> > 
> >         .line 7 'array.int2'
> >         {       // #1
> >         ldarg.0
> >         ldarg.1
> >         ldarg.2
> >         call    bool
> >                 ['mer_std__csharp_code']'mer_std__csharp_code'.'mercury_code'::'special___Unify___array_1_0'(
> >                         object[],
> >                         class ['mscorlib']'System'.'Array',
> >                         class ['mscorlib']'System'.'Array'
> >                 )
> >         }       // #1
> >         ret
> > }
> > 
> > ilasm barfs on this because we don't have an assembly reference to
> > mer_std__csharp_code earlier,
> 
> Perhaps we should fix it to generate the appropriate assembly reference?
> 
We could do that, but we would still have more problems.

There is no mer_std__csharp_code.cs file generated, nor would it contain
special___Unify___array_1_0 even if we generated the file.  So if we
ever called this code we would have a problem.

> > however I don't think we should be
> > generating this code at all because there is mer_std__csharp_code which
> > contains special___Unify___array_1_0.
> 
> The method definition shown above is just a forwarding wrapper
> that forwards calls to this procedure which assume that it is
> defined in the Mercury code to the external definition in the C# code.
> That is how we handle "external" procedures in the .NET back-end.
> It looks OK to me.  I don't see why you think this code is wrong.
> 
See above for more reasons why the code is wrong.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list