Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#118 break statement outside of a loop/switch body

Bug
closed-fixed
nobody
5
2011-02-15
2010-05-31
virgile
No

In cil version 1.3.7, it seems that cabs2cil does not attempt to detect whether a break
statement occurs in a loop/switch body or not (continue is checked
appropriately). This can lead to random errors later, as some functions (e.g. prepareCFG)
rely on the fact that a break statement is correctly enclosed in a loop/switch body.

Attached is a patch against 1.3.7 that will raise an Error if an isolated break occurs.

Discussion

  • virgile
    virgile
    2010-05-31

    patch for cabs2cil.ml

     
    Attachments
    • status: open --> closed-fixed
     
  • Thanks for the patch. Applied in svn.