Project

General

Profile

Bug #5239

CASE WHEN statement: unreachable break statements are sometimes inserted

Added by Adrian Lungu about 3 years ago. Updated about 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
04/05/2021
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:

testcase.p Magnifier (864 Bytes) Adrian Lungu, 04/05/2021 04:30 AM

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 a stop statement (unreachable break is added)
  • do while true containing an undo, leave statement (unreachable break is added)
  • do while true containing a message and quit statement (unreachable break is added)

#3 Updated by Adrian Lungu about 3 years ago

This is a testcase which reproduces all scenarios in #5239-1.

Also available in: Atom PDF