Bug #5239
CASE WHEN statement: unreachable break statements are sometimes inserted
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/05/2021
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
History
#1 Updated by Adrian Lungu about 3 years ago
Due to unreachable.xml
rules, some CASE-WHEN/OTHER ASTs are annotated with unreachable_break
, such that the conversion avoids inserting a break statement at the end of a switch-case, as it will be unreachable (resulting in javac error).
However, there are still cases in which the CASE-WHEN/OTHER ASTs are not annotated and an unreachable break statement is inserted:
do while true
containing astop
statement (unreachable break is added)do while true
containing anundo, leave
statement (unreachable break is added)do while true
containing amessage
andquit
statement (unreachable break is added)
#3 Updated by Adrian Lungu about 3 years ago
- File testcase.p added
This is a testcase which reproduces all scenarios in #5239-1.