Files
mercury/tests/hard_coded/lookup_switch_simple_cond.exp
Zoltan Somogyi 59989c95a8 Fix Mantis bug #170.
Estimated hours taken: 4
Branches: main

Fix Mantis bug #170.

The problem involved a string switch inlined into the condition of an
if-then-else in the predicate execute_cmd_string. The switched-on variable,
CmdWord, is not used in or after the switch in the condition or the then part,
so it becomes forward dead in the switch, but it IS used in the else part.
This requires it to be made a zombie when it forward dies, so it can be
resurrected at the start of the else part. The initial implementation of
string hash lookup switches did not do that.

compiler/string_switch.m:
	Fix the bug by making all variables being made forward dead into
	zombies if they are needed by an enclosing resume point.

compiler/lookup_switch.m:
	Fix the same bug in switches on atomic types.

compiler/var_locn.m:
	Fix the format of some documentation.

ssdb/Mercury.options:
	Remove the workaround for bug #170, since it won't be needed
	once the diff to the compiler is installed.

tests/hard_coded/lookup_switch_simple_cond.{m,exp}:
	A version of the existing lookup_switch_simple test case that puts
	the switch in a condition, to test the fix to lookup_switch.m. The
	compilation of ssdb/ssdb.m with -O5 is the test case for the fix
	to string_switch.m.

tests/hard_coded/Mmakefile:
	Enable the new test case.
2010-11-30 04:06:59 +00:00

5 lines
118 B
Plaintext

N = 1: no solution for 1
N = 2: 22 2.2 "two" 222 - 223
N = 3: 33 3.3 "three" 222 - 224
N = 4: 44 4.4 "four" 222 - 225