view tests/mini/bug308_double_finally.d @ 1439:679ac907c82f

Add `nest` attribute to `this` parameters on x86-64. This is a free extra parameter register :).
author Frits van Bommel <fvbommel wxs.nl>
date Sun, 31 May 2009 10:41:20 +0200
parents f9285cf14c0d
children
line wrap: on
line source

extern(C) int printf(char*, ...);

long foo(ref int p) {
    try { return 0; }
    finally {
        p++;
        throw new Object;
    }
}

void main() {
    int p = 0;
    try {
        foo(p);
        assert(0);
    } catch {
    }
    printf("Number of types scope(exit) was executed : %d\n", p);
    assert(p == 1);
}