diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2007-07-16 13:15:37 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2007-07-16 13:15:37 +0000 |
commit | 503de4705ff6537018ae94e9179e16636748b2a6 (patch) | |
tree | d022d6d730a079eac8721ce355c9ae08c781a689 /perly.y | |
parent | 4629c4f60ec83d0f102cd8ac641c8eefa2bb4a6f (diff) | |
download | perl-503de4705ff6537018ae94e9179e16636748b2a6.tar.gz |
[perl #43425] local $[: fix scoping during parser error handling.
Change 22306# inadvertently made 'local $[' statement-scoped
rather than block-scoped; so revert that change and add a
different fix. The problem was to ensure that the savestack got
popped correctly while popping errored tokens. We how record the
current value of PL_savestack_ix with each pushed parser state.
p4raw-id: //depot/perl@31615
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -79,7 +79,7 @@ %token <i_tkval> LOCAL MY MYSUB REQUIRE %token <i_tkval> COLONATTR -%type <ival> prog progstart remember mremember savescope +%type <ival> prog progstart remember mremember %type <ival> startsub startanonsub startformsub /* FIXME for MAD - are these two ival? */ %type <ival> mydefsv mintro @@ -175,9 +175,6 @@ mremember: /* NULL */ /* start a partial lexical scope */ { $$ = block_start(FALSE); } ; -savescope: /* NULL */ /* remember stack pos in case of error */ - { $$ = PL_savestack_ix; } - /* A collection of "lines" in the program */ lineseq : /* NULL */ { $$ = Nullop; } @@ -188,12 +185,13 @@ lineseq : /* NULL */ (LISTOP*)$1, (LISTOP*)$2), $1); } - | lineseq savescope line - { LEAVE_SCOPE($2); - $$ = append_list(OP_LINESEQ, - (LISTOP*)$1, (LISTOP*)$3); + | lineseq line + { $$ = append_list(OP_LINESEQ, + (LISTOP*)$1, (LISTOP*)$2); PL_pad_reset_pending = TRUE; - if ($1 && $3) PL_hints |= HINT_BLOCK_SCOPE; } + if ($1 && $2) + PL_hints |= HINT_BLOCK_SCOPE; + } ; /* A "line" in the program */ |