[m-rev.] for pos-commit review: fix foreign enum switches

Julien Fischer juliensf at csse.unimelb.edu.au
Fri Sep 7 19:57:51 AEST 2007


On Fri, 7 Sep 2007, Zoltan Somogyi wrote:

> For review by Julien.
>
> I am committhing this diff now since its only effect is to convert an abort
> to useful behavior, and since I want it installed as soon as possible.
> (My next diff wants to use switches on foreign enums.)
>
> Zoltan.
>
> Fix a bug that caused an abort of the MLDS code generator when it was given a
> switch on a value of a foreign enum.
>
> compiler/ml_switch_gen.m:
> 	The bug was caused by the fact that the code that handles switches
> 	handled only two kinds of tags (ints and strings), and did not list
> 	the kinds of tags it did NOT handle. Change that to handle foreign
> 	tags, and switch to using a switch instead of an if-then-else chain
> 	to prevent the problem from recurring in the future.
>
> compiler/options.m:
> 	Add an option to allow the configure script to recognize the presence
> 	of the fix, since we can't add code to the compiler that switches on
> 	foreign enums unless the fix is installed.
>
>
> tests/hard_coded/foreign_enum_switch.{m,exp}:
> 	A new test case to test the fix.
>
> tests/hard_coded/Mmakefile:
> 	Enable the new test case.

That looks fine.  Thanks for fixing that.

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