[m-rev.] diff: box value classes on IL backend

Tyson Dowd trd at cs.mu.OZ.AU
Mon Jan 14 22:35:24 AEDT 2002


On 14-Jan-2002, Peter Ross <peter.ross at miscrit.be> wrote:
> Hi,
> 
> 
> ===================================================================
> 
> 
> Estimated hours taken: 12
> Branches: main
> 
> Fix a bug where value classes introduced by pragma foreign type's were
> not being boxed.  Note that we don't detect all possible value classes
> just the ones which are represented specially by the .NET backend.
> 
> ilasm.m:
>     Move name_to_simple_type to the interface.
> 
> mlds_to_il.m:
>     Check whether a class is a value class before deciding whether or
>     not it has been already boxed.


I don't see how this code can be buggy, or that this is a fix for the
code.

First, foreign_types don't introduce value classes.  They only introduce
reference classes.  So I have no idea what kind of test code would set
off this bug.

Second, the code actually looks for ilds__type(class(...)) but if the
type truly is a value class it should be ilds__type(value_class(...))
instead, so any errors must occur further upstream.

And finally even if it were the right place to fix this problem it only
fixes it for a small number of cases -- I my opinion this is evidence of
it being the wrong fix -- there is no way to fix the problem correctly
at this point because there is no way to know whether a "class" is
really a "value class" -- the correct way to find that is to distinguish
class from value_class.

-- 
       Tyson Dowd           # 
                            #  Surreal humour isn't everyone's cup of fur.
     trd at cs.mu.oz.au        # 
http://www.cs.mu.oz.au/~trd #
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list