Dechenjm / crack-language

Automatically exported from code.google.com/p/crack-language
Other
0 stars 0 forks source link

variables declared in a loop body eat the stack #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Run the script below.  You'll get a seg-fault when you run out of stack.

int64 sum(int64 a, int64 b, int64 c, int64 d, int64 e, int64 f, int64 g, 
         int64 h, int64 i, int64 j, int64 k) {
    return a + b + c + d + e + f + g + h + i + j + k;
}

void func() {
    while (1 == 1) {
        int64 a = 1, b = 2, c = 3, d = 4, e = 5, f = 6, g = 7, h = 8, i = 9, 
            j = 10, k = 11;
        a = sum(a, b, c, d, e, f, g, h, i, j, k);
        printint(int(a));
    }
}

func();

Original issue reported on code.google.com by mind...@gmail.com on 1 Jul 2010 at 5:24

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 1 Jul 2010 at 5:45

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 1 Jul 2010 at 8:10

GoogleCodeExporter commented 9 years ago

Original comment by mind...@gmail.com on 30 Jul 2010 at 2:09