clever-lang/clever — Issue #53: Weird recursivity problem
Author: heuripedes
Created: 2012-01-05 21:37:23+00:00
State: open
Labels: Bug, VM

I'm not sure yet if its a recursivity problem, but you can see what happens when you execute a snippet as simple as this one :

import std.io;

Int fact(Int n) {
if (n == 0) {
return 1;
}

Int f = fact(n-1);
Int r = n * f;
return r;
}

println(fact(5));

It is supposed to print 120, but instead it prints 0. If you print the `n` for every iteration, you'll notice that the function gets called, so, i suppose its a problem with the return values. Valgrind reports no access violation.