File: ctrl_continue.ck

package info (click to toggle)
chuck 1.5.5.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 41,056 kB
  • sloc: cpp: 123,473; ansic: 35,893; javascript: 2,111; yacc: 609; makefile: 457; python: 174; perl: 86
file content (27 lines) | stat: -rw-r--r-- 481 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// continue in nested block
 
0 => int j;
0 => int i;
0 => int check;

// loop
while ( j < 5 )
{
    0 => i;
    while ( i < 5 )
    {
        1 +=> i;  
        if ( j < 4 ) continue;  

        // because of continue, this only happens in last ( j==0 )
        2 +=> check; 
    }

    // if continue malfunctions, this is skipped, and we get INFINITE LOOP 
    1 +=> j;
}

// make sure that continue does the right thing in the inner loop?
if ( check == 10 ) <<<"success">>>;