On Fri, Jul 01, 2005 at 02:34:27PM +0200, Leopold Toetsch wrote: > Please not that this has nothing to do with register spilling, where due > to a lack of registers these are stored into (and fetched from) an array > in P31. We've got a problem of a register changing it's value - or not.
Noted, and thanks for the clarification. > After another half of a day with gdb, I've eventually tracked it down. > [...] > lastpos = length target > if pos >= 0 goto try_at_pos > pos = 0 > try_match: > cutting = 0 > ... > try_at_pos: > ... > if cutting != 0 goto fail <<<< bails out at first > > "pos" is already 1, therefore "cutting" get's never initialized and has > some garbage value. You're absolutely correct, and many thanks for the work in catching this. Originally the "cutting = 0" initializer was at the top of the routine, but apparently when I added the try_match loop I didn't move it to outside of the loop. > I don't think that Parrot should guarantee that registers have some > predifined value on entering a subroutine. I fully agree. Again, thanks for the effort in tracking this down. Now fixed in r8484. Pm