[m-rev.] for review: fix bug #129

Julien Fischer juliensf at csse.unimelb.edu.au
Mon Jan 25 01:47:03 AEDT 2010


Hi Peter,

On Fri, 22 Jan 2010, Peter Wang wrote:

> Still trying to make a small test case.  It bootchecks okay.

Out of curiosity I would like to see the code that caused this -- it
seems odd that this hasn't been noticed before.  (Actually, given the
rarity of instances with a non-zero number of unconstrained type variables 
maybe it isn't.)

> Branches: main
>
> During higher-order specialisation, `interpret_typeclass_info_manipulator'
> incorrectly simulated the execution of the macros
> `MR_typeclass_info_superclass_info' and `MR_typeclass_info_param_type_info'.
>
> The macros extract an argument of a typeclass_info vector, the offset of which
> is given by `MR_typeclass_info_num_extra_instance_args(tci) + n'.
> The computation used in `interpret_typeclass_info_manipulator' was actually
> equivalent to `MR_typeclass_info_num_instance_constraints(tci) + n'.
>
> Since "MR_typeclass_info_num_extra_instance_args gives the sum of
> MR_typeclass_info_num_instance_type_vars and
> MR_typeclass_info_num_instance_constraints", the offset would be off by the
> number of (unconstrained) type variables.
>
> This fixes bug #129.
>
> compiler/higher_order.m:
>        As above.
>
>        Add a sanity check.
>
> library/private_builtin.m:
>        Delete some unnecessary casts in Java foreign_procs.
>
> runtime/mercury_type_info.h:
>        Fix a typo.

The diff looks fine.

Julien.
--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list