Path: utzoo!attcan!uunet!lll-winken!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: recursion problems Keywords: perl recursion local bug Message-ID: <7197@jpl-devvax.JPL.NASA.GOV> Date: 27 Feb 90 17:40:03 GMT References: <100264@convex.convex.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 20 In article <100264@convex.convex.com> tchrist@convex.Com (Tom Christiansen) writes: : I have a resursive subroutine with all local variables : that is having problems with its return value. Precisely, : it's saying it's returning a local @list, but when the : return value delivered back to the caller is actually @_[0], : the subroutine's first called-with parameter. : : Has anyone else seen this? When I isolate the routine : into a brief test-case, the problem goes away, as I : find so often to be the case. Larry, have you made : any fixes for patch9 that might be related to this problem? Yes, this sounds exactly like something I fixed. The problem is that the stack is getting realloced, and the code for processing the returned array value was using the old stack instead of the new one. The reason the problem goes away when you try to construct a test case is that the stack shrinks and then doesn't realloc at that juncture. Larry