develooper Front page | perl.perl6.internals | Postings from February 2006

Re: Allowing push/pop across sub calls

Thread Previous | Thread Next
From:
Patrick R. Michaud
Date:
February 22, 2006 21:01
Subject:
Re: Allowing push/pop across sub calls
Message ID:
20060223050149.GF17378@host.pmichaud.com
On Wed, Feb 22, 2006 at 10:06:22PM -0600, Patrick R. Michaud wrote:
> Based on the trace I just looked at, it appears that a save opcode 
> executed inside a coroutine -- the coroutine generated to handle
> the <after c> subrule -- is indeed affecting the results of a
> restore in the caller and causing an infinite loop.  In particular,
> I'm seeing the following sequence...

Just in case it makes a difference, I should also note that
the call to the coroutine is nested inside of a couple of other
sub invocations.  So, a more complete picture goes something like:

    ...
    save I1                (trace shows I1=1)
    invoke PGE::Rule::after
      invoke "[c]$" subrule
        invoke coroutine for "[c]$" subrule
          I1 = 0
          save I1          (trace shows I1=0)
          ...
        yield from "[c]$" coroutine
      return from "[c]$" subrule
    return from PGE::Rule::after
    restore I1
    inc I1                 (trace shows I1=0 (!))

Pm

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About