Menu

#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

     
  • Gabriel Kerneis

    Gabriel Kerneis - 2011-02-15
    • status: open --> closed-fixed
     
  • Gabriel Kerneis

    Gabriel Kerneis - 2011-02-15

    Thanks for the patch. Applied in svn.

     

Log in to post a comment.