mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
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.
5 lines
118 B
Plaintext
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
|