Here's another case that I'm not sure you're handling correctly...conditional breaks:

switch (expr) {
case c0:
case c1:
    stmt0;
case c2:
case c3:
    stmt1;
    break;
case c4:
    stmt2;
    if (foo)
        break;
    stmt3;        // happens if !foo
case c5:
default:
    stmt4;        // happens if (expr != c4 || foo)
};

The easiest solution I can think of is to (in C++) track whether a break -might- have been taken and emit a guard around further statements:

stmt2;
if (foo)
   has_break_tmp = true; // hit the break statement

if (has_break_tmp) { // could have potentially hit "break", must check
    stmt3;
}
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to