Files
mercury/tests/hard_coded/foreign_enum_switch.exp
Zoltan Somogyi 0c87e77334 Fix a bug that caused an abort of the MLDS code generator when it was given a
Estimated hours taken: 1
Branches: main

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.
2007-09-07 09:56:05 +00:00

4 lines
9 B
Plaintext