Nicolas Cannasse wrote:
So it's still that same line, vm/others.c:346. This time, however,
the previous allocation apparently succeeds. It stills fails because
the variable i turns out to be negative when it probably should be
positive. I'm wondering if this has something to do with 32-bit
assumptions somewhere.
Are you on a 64-bit system ? If so, then please have a look at the
neko_stack_expand implementation. int_val should be a 64-bit int.
Please add prints of "size" and "i" and try to understand why "i" is
negative, which of course it shouldn't be...
Well, quite simply the variable i is negative in this case because
vm->spmin is bigger than csp or vm->csp. Unfortunately I haven't a clue
what those variables mean, and I don't know enough about neko internals
to understand why that would be the case. Size, on the other hand, is a
reasonable positive value so that's why the allocation at least doesn't
fail. I also don't have the time at the moment to dig much deeper, but
hopefully I can spend some time on it later.
Regards,
Chaz
--
Neko : One VM to run them all
(http://nekovm.org)