mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-12 12:26:29 +00:00
Fix a Zoltan bug! ;-)
tag_switch.m: Fix a Zoltan bug! ;-) This was the bug causing the "Software error: no failure continuation" errors. The problem was that when Zoltan changed the field in switches from a determism to can_fail/cannot_fail, he accidentally inverted the sense of a test, causing the code to generate the "fail" case only for tag switches which can never fail.
This commit is contained in:
@@ -76,10 +76,10 @@ tag_switch__generate(Cases, Var, CodeModel, CanFail, EndLabel, Code) -->
|
||||
% we generate FailCode and EndCode here because the last case within
|
||||
% a primary tag may not be the last case overall
|
||||
(
|
||||
{ CanFail = can_fail },
|
||||
{ CanFail = cannot_fail },
|
||||
{ FailCode = empty }
|
||||
;
|
||||
{ CanFail = cannot_fail },
|
||||
{ CanFail = can_fail },
|
||||
code_info__generate_failure(FailCode1),
|
||||
{ FailCode = tree(
|
||||
node([label(FailLabel) - "switch has failed"]),
|
||||
|
||||
Reference in New Issue
Block a user