On 06/27/2011 04:40 PM, Kenneth Graunke wrote:
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; }
This is similar to the proposal that I floated Fri PM and that you commented upon at 17:15 today.
Please correct me if I'm wrong. cheers, danm _______________________________________________ mesa-dev mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-dev
