[m-rev.] For review: fix a mode analysis bug

Mark Brown mark at cs.mu.OZ.AU
Wed Oct 26 12:53:24 AEST 2005


On 26-Oct-2005, Ralph Becket <rafe at cs.mu.OZ.AU> wrote:
> Estimated hours taken: 13
> Branches: main
> 
> Mode analysis was aborting in a program where it was inserting a new
> variable for an implied mode unification, but the new variable id
> already had a (non-free) mapping in the instmap, which led to a
> compiler abort (it thought it was about to enter an infinite loop).
> 
> This problem was introduced when Mark changed modes.build_call with
> his recent fixes for polymorphism.  modes.build_call extracts the
> module_info from the mode_info, then the proc_info for the current
> proc from the module_info.  However, at this point the proc_info has
> out-of-date varset and vartypes fields, because mode analysis can
> introduce temporary variables for implied mode unifications.
> 
> compiler/modes.m:
> 	Ensure that modes.build_call first takes the current varset and
> 	vartypes fields from the mode_info and used them to update the
> 	current proc_info before using it to construct an initialisation
> 	call.
> 
> tests/hard_coded/Mmakefile:
> tests/hard_coded/solver_build_call.m:
> tests/hard_coded/solver_build_call.exp:
> 	Added a test case.

This looks fine, except...

> Index: tests/debugger/mdb_command_test.inp
> ===================================================================
> RCS file: /home/mercury1/repository/tests/debugger/mdb_command_test.inp,v
> retrieving revision 1.47
> diff -u -r1.47 mdb_command_test.inp
> --- tests/debugger/mdb_command_test.inp	25 Oct 2005 04:00:53 -0000	1.47
> +++ tests/debugger/mdb_command_test.inp	26 Oct 2005 01:56:34 -0000
> @@ -95,4 +95,3 @@
>  class_decl           xyzzy xyzzy xyzzy xyzzy xyzzy
>  all_class_decls      xyzzy xyzzy xyzzy xyzzy xyzzy
>  all_procedures       xyzzy xyzzy xyzzy xyzzy xyzzy
> -ambiguity            xyzzy xyzzy xyzzy xyzzy xyzzy

...this shouldn't be part of the change.

Cheers,
Mark.

--------------------------------------------------------------------------
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