Wiki

Ticket #66 (closed defect: fixed)

Opened 16 years ago

Last modified 15 years ago

Missing error checking on out-of-place "break" or "continue"

Reported by: Chuck Owned by: eric.sellon
Priority: trivial Milestone:
Component: Cobra Compiler Version: 0.8.0
Keywords: Cc:

Description

Cobra does not catch when "break" and "continue" are used outside a "for" or "while" loop. The problems drops through to the C# backend.

Attachments

ticket66.patch Download (3.3 KB) - added by eric.sellon 15 years ago.

Change History

Changed 15 years ago by eric.sellon

  • owner set to eric.sellon
  • status changed from new to accepted

Changed 15 years ago by eric.sellon

Attached patch file. Should be good to go. Added (minimal) loop scope tracking logic in order to fix this issue.

Changed 15 years ago by Chuck

  • status changed from accepted to assigned

I don't see any test cases for this. Take a look in the <workspace>\Tests directory.

Minor nit: For a boolean var, just use foo instead of foo == true since the var is already a boolean.

Changed 15 years ago by eric.sellon

Changed 15 years ago by eric.sellon

Updated fix for minor nit ;)
Added test; test is predicated on use of recordError as there are multiple errors in the test

Changed 15 years ago by Chuck

  • status changed from assigned to closed
  • resolution set to fixed

Applied in changeset:2100

Note: See TracTickets for help on using tickets.