This is another test from the paper "Decompiling Java Bytecode: Problems, Traps and Pitfalls", Figure 5. The source code as adapted to C# is:
using System;
class Foo {
    public static int foo(int i, int j) {
        while (true) {
            try
            {   while (i < j)
                    i = j++/i;
            }
            catch (Exception e)
            {   i = 10;
                continue;
            }
            break;
        }
        return j;
    }
    public static void Main(String[] args) {
        foo(2, 3);
    }
}

The while (true) and the continue seem to throw some decompilers.

-- MikeVanEmmerik - 07 Mar 2003
CategoryDecompilation

Revision: r1.2 - 11 Mar 2003 - 02:50 - MikeVanEmmerik
Copyright © 1999-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback