diff options
author | Dave Mitchell <davem@fdisolutions.com> | 2004-02-15 00:24:26 +0000 |
---|---|---|
committer | Dave Mitchell <davem@fdisolutions.com> | 2004-02-15 00:24:26 +0000 |
commit | 500bedb6c28d0918a4bd28632e742d0905ce8519 (patch) | |
tree | 3bbed23b46dd15027bd2173c4d593faea7275821 /perly.y | |
parent | 9388183fea7d692a0a6ded83ccc01767a8af49cf (diff) | |
download | perl-500bedb6c28d0918a4bd28632e742d0905ce8519.tar.gz |
[perl #25824] Segmentation fault with
sub x { shift; @a = @b; eval +{ use } }
p4raw-id: //depot/perl@22306
Diffstat (limited to 'perly.y')
-rw-r--r-- | perly.y | 14 |
1 files changed, 9 insertions, 5 deletions
@@ -40,7 +40,7 @@ %token COLONATTR %type <ival> prog decl format startsub startanonsub startformsub -%type <ival> progstart remember mremember '&' +%type <ival> progstart remember mremember '&' savescope %type <opval> block mblock lineseq line loop cond else %type <opval> expr term subscripted scalar ary hsh arylen star amper sideff %type <opval> argexpr nexpr texpr iexpr mexpr mnexpr mtexpr miexpr @@ -116,16 +116,20 @@ 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; } | lineseq decl { $$ = $1; } - | lineseq line - { $$ = append_list(OP_LINESEQ, - (LISTOP*)$1, (LISTOP*)$2); + | lineseq savescope line + { LEAVE_SCOPE($2); + $$ = append_list(OP_LINESEQ, + (LISTOP*)$1, (LISTOP*)$3); PL_pad_reset_pending = TRUE; - if ($1 && $2) PL_hints |= HINT_BLOCK_SCOPE; } + if ($1 && $3) PL_hints |= HINT_BLOCK_SCOPE; } ; /* A "line" in the program */ |