stack grow direction wrongly detected
Sat Mar 6 01:06:57 GMT 2021
On Fri, 5 Mar 2021 21:29:49 +0100
Marco Atzeri wrote:
> guile 1.8.8 is 10 years old, but it is still used by some programs
> as all the guile 2.x series were slower.
> the code on recent guile 3.0.x is different, with no recursion at all.
> find_stack_direction (int *addr, int depth)
> int dir, dummy = 0;
> if (! addr)
> addr = &dummy;
> *addr = addr < &dummy ? 1 : addr == &dummy ? 0 : -1;
> dir = depth ? find_stack_direction (addr, depth - 1) : 0;
This calls find_stack_direction() recursively, isn't it?
> return dir + dummy;
> main (int argc, char **argv)
> return find_stack_direction (0, argc + !argv + 20) < 0;
Recursion depth seems to be increased to more than 20.
Takashi Yano <firstname.lastname@example.org>
More information about the Cygwin