Frama-C Bug Tracking System - Frama-C
View Issue Details
0002119Frama-CKernelpublic2015-05-20 15:112016-01-26 13:50
hugo.illous 
yakobowski 
normalminoralways
closedfixed 
 
Frama-C Magnesium 
0002119: "If" statement with only one successor
When a "If" statements contains in its true block the sequence "do {} while (0);", in the CFG, this statement will have only one successor.
You can simply try with this C program and compute List.length stmt.succs void f(int n) { if (n == 0) do {} while (0); }
No tags attached.
Issue History
2015-05-20 15:11hugo.illousNew Issue
2015-05-22 10:15signolesAssigned To => virgile
2015-05-22 10:15signolesStatusnew => assigned
2015-05-23 11:32yakobowskiAssigned Tovirgile => yakobowski
2015-05-23 11:58yakobowskiNote Added: 0005922
2015-05-23 11:58yakobowskiNote Edited: 0005922View Revisions
2015-05-29 11:25yakobowskiNote Added: 0005926
2015-05-29 11:25yakobowskiStatusassigned => resolved
2015-05-29 11:25yakobowskiResolutionopen => fixed
2015-06-10 14:16monateNote Added: 0005940
2015-06-10 14:17monateNote Added: 0005941
2016-01-26 08:51signolesFixed in Version => Frama-C Magnesium
2016-01-26 08:52signolesStatusresolved => closed
2016-01-26 13:50yakobowskiNote Added: 0006135

Notes
(0005922)
yakobowski   
2015-05-23 11:58   
To clarify a bit: the AST is not outright incorrect, because the statement corresponding to 'return' is indeed the successor of both the 'then' and 'else' branch. Thus one unique successor may make sense. On the other hand, it is much better for everyone to always have two successors for an 'if', furthermore ordered by 'then < else'.
(0005926)
yakobowski   
2015-05-29 11:25   
Fix committed to master branch.
(0005940)
monate   
2015-06-10 14:16   
C'est en cours !
(0005941)
monate   
2015-06-10 14:17   
Mais avec une petite vérification de cohérence de sid quand même, donc ça sera un peu plus long...
(0006135)
yakobowski   
2016-01-26 13:50   
Hum, honnêtement, c'est tellement obscur que ça ne concernera personne, et je n'arriverai pas à l'expliquer dans le Changelog.