xpcom/tests/static-checker/flow_through_fail.cpp

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/tests/static-checker/flow_through_fail.cpp	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,16 @@
     1.4 +static void MUST_FLOW_THROUGH(const char *label) {
     1.5 +}
     1.6 +
     1.7 +int test(int x, int y) {
     1.8 +  MUST_FLOW_THROUGH("out");
     1.9 +  
    1.10 +  if (!x) {
    1.11 +    x = y;
    1.12 +    goto out;
    1.13 +  }
    1.14 +
    1.15 +  return y;
    1.16 + out:
    1.17 +  x--;
    1.18 +  return x;
    1.19 +}

mercurial