From: Dave Mitchell Date: Fri, 26 May 2006 18:50:34 +0000 (+0000) Subject: stop eval "sub{" leaking X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a8ff2fa6faa01a256e2aff8c5e61378859eb3d62;p=p5sagit%2Fp5-mst-13.2.git stop eval "sub{" leaking p4raw-id: //depot/perl@28314 --- diff --git a/madly.act b/madly.act index 85626c9..788efa8 100644 --- a/madly.act +++ b/madly.act @@ -431,7 +431,8 @@ case 2: case 61: #line 446 "madly.y" - { (yyval.opval) = newFORM((yyvsp[-2].ival), (yyvsp[-1].opval), (yyvsp[0].opval)); + { SvREFCNT_inc(PL_compcv); + (yyval.opval) = newFORM((yyvsp[-2].ival), (yyvsp[-1].opval), (yyvsp[0].opval)); prepend_madprops((yyvsp[-3].tkval)->tk_mad, (yyval.opval), 'F'); (yyvsp[-3].tkval)->tk_mad = 0; token_free((yyvsp[-3].tkval)); @@ -439,25 +440,27 @@ case 2: break; case 62: -#line 453 "madly.y" +#line 454 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 63: -#line 454 "madly.y" +#line 455 "madly.y" { (yyval.opval) = Nullop; ;} break; case 64: -#line 459 "madly.y" - { (yyval.opval) = newMYSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); +#line 460 "madly.y" + { SvREFCNT_inc(PL_compcv); + (yyval.opval) = newMYSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-5].tkval),(yyval.opval),'d'); ;} break; case 65: -#line 466 "madly.y" - { OP* o = newSVOP(OP_ANONCODE, 0, +#line 468 "madly.y" + { SvREFCNT_inc(PL_compcv); + OP* o = newSVOP(OP_ANONCODE, 0, (SV*)newATTRSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval))); (yyval.opval) = newOP(OP_NULL,0); op_getmad(o,(yyval.opval),'&'); @@ -471,22 +474,25 @@ case 2: break; case 66: -#line 480 "madly.y" - { (yyval.ival) = start_subparse(FALSE, 0); ;} +#line 483 "madly.y" + { (yyval.ival) = start_subparse(FALSE, 0); + SAVEFREESV(PL_compcv); ;} break; case 67: -#line 484 "madly.y" - { (yyval.ival) = start_subparse(FALSE, CVf_ANON); ;} +#line 489 "madly.y" + { (yyval.ival) = start_subparse(FALSE, CVf_ANON); + SAVEFREESV(PL_compcv); ;} break; case 68: -#line 488 "madly.y" - { (yyval.ival) = start_subparse(TRUE, 0); ;} +#line 494 "madly.y" + { (yyval.ival) = start_subparse(TRUE, 0); + SAVEFREESV(PL_compcv); ;} break; case 69: -#line 492 "madly.y" +#line 499 "madly.y" { const char *const name = SvPV_nolen_const(((SVOP*)(yyvsp[0].opval))->op_sv); if (strEQ(name, "BEGIN") || strEQ(name, "END") || strEQ(name, "INIT") || strEQ(name, "CHECK")) @@ -495,57 +501,57 @@ case 2: break; case 70: -#line 501 "madly.y" +#line 508 "madly.y" { (yyval.opval) = Nullop; ;} break; case 72: -#line 507 "madly.y" +#line 514 "madly.y" { (yyval.opval) = Nullop; ;} break; case 73: -#line 509 "madly.y" +#line 516 "madly.y" { (yyval.opval) = (yyvsp[0].opval); token_getmad((yyvsp[-1].tkval),(yyval.opval),':'); ;} break; case 74: -#line 513 "madly.y" +#line 520 "madly.y" { (yyval.opval) = newOP(OP_NULL, 0); token_getmad((yyvsp[0].tkval),(yyval.opval),':'); ;} break; case 75: -#line 520 "madly.y" +#line 527 "madly.y" { (yyval.opval) = (yyvsp[0].opval); token_getmad((yyvsp[-1].tkval),(yyval.opval),':'); ;} break; case 76: -#line 524 "madly.y" +#line 531 "madly.y" { (yyval.opval) = newOP(OP_NULL, 0); token_getmad((yyvsp[0].tkval),(yyval.opval),':'); ;} break; case 77: -#line 530 "madly.y" +#line 537 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 78: -#line 531 "madly.y" +#line 538 "madly.y" { (yyval.opval) = newOP(OP_NULL,0); PL_expect = XSTATE; token_getmad((yyvsp[0].tkval),(yyval.opval),';'); ;} break; case 79: -#line 537 "madly.y" +#line 544 "madly.y" { (yyval.opval) = package((yyvsp[-1].opval)); token_getmad((yyvsp[-2].tkval),(yyval.opval),'o'); token_getmad((yyvsp[0].tkval),(yyval.opval),';'); @@ -553,13 +559,14 @@ case 2: break; case 80: -#line 544 "madly.y" +#line 551 "madly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;} break; case 81: -#line 546 "madly.y" - { (yyval.opval) = utilize(((yyvsp[-6].tkval))->tk_lval.ival, (yyvsp[-5].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval)); +#line 553 "madly.y" + { SvREFCNT_inc(PL_compcv); + (yyval.opval) = utilize(((yyvsp[-6].tkval))->tk_lval.ival, (yyvsp[-5].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval)); token_getmad((yyvsp[-6].tkval),(yyval.opval),'o'); token_getmad((yyvsp[0].tkval),(yyval.opval),';'); if (PL_rsfp_filters && AvFILLp(PL_rsfp_filters) >= 0) @@ -568,28 +575,28 @@ case 2: break; case 82: -#line 556 "madly.y" +#line 564 "madly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 83: -#line 560 "madly.y" +#line 568 "madly.y" { (yyval.opval) = newLOGOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 84: -#line 564 "madly.y" +#line 572 "madly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 86: -#line 572 "madly.y" +#line 580 "madly.y" { OP* op = newNULLLIST(); token_getmad((yyvsp[0].tkval),op,','); (yyval.opval) = append_elem(OP_LIST, (yyvsp[-1].opval), op); @@ -597,7 +604,7 @@ case 2: break; case 87: -#line 577 "madly.y" +#line 585 "madly.y" { (yyvsp[0].opval) = newUNOP(OP_NULL, 0, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyvsp[0].opval),','); @@ -606,7 +613,7 @@ case 2: break; case 89: -#line 587 "madly.y" +#line 595 "madly.y" { (yyval.opval) = convert(((yyvsp[-2].tkval))->tk_lval.ival, OPf_STACKED, prepend_elem(OP_LIST, newGVREF(((yyvsp[-2].tkval))->tk_lval.ival,(yyvsp[-1].opval)), (yyvsp[0].opval)) ); token_getmad((yyvsp[-2].tkval),(yyval.opval),'o'); @@ -614,7 +621,7 @@ case 2: break; case 90: -#line 592 "madly.y" +#line 600 "madly.y" { (yyval.opval) = convert(((yyvsp[-4].tkval))->tk_lval.ival, OPf_STACKED, prepend_elem(OP_LIST, newGVREF(((yyvsp[-4].tkval))->tk_lval.ival,(yyvsp[-2].opval)), (yyvsp[-1].opval)) ); token_getmad((yyvsp[-4].tkval),(yyval.opval),'o'); @@ -624,7 +631,7 @@ case 2: break; case 91: -#line 599 "madly.y" +#line 607 "madly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, scalar((yyvsp[-5].opval)), (yyvsp[-1].opval)), @@ -636,7 +643,7 @@ case 2: break; case 92: -#line 608 "madly.y" +#line 616 "madly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, scalar((yyvsp[-2].opval)), newUNOP(OP_METHOD, 0, (yyvsp[0].opval)))); @@ -645,7 +652,7 @@ case 2: break; case 93: -#line 614 "madly.y" +#line 622 "madly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-1].opval), (yyvsp[0].opval)), @@ -654,7 +661,7 @@ case 2: break; case 94: -#line 620 "madly.y" +#line 628 "madly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-3].opval), (yyvsp[-1].opval)), @@ -665,14 +672,14 @@ case 2: break; case 95: -#line 628 "madly.y" +#line 636 "madly.y" { (yyval.opval) = convert(((yyvsp[-1].tkval))->tk_lval.ival, 0, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 96: -#line 632 "madly.y" +#line 640 "madly.y" { (yyval.opval) = convert(((yyvsp[-3].tkval))->tk_lval.ival, 0, (yyvsp[-1].opval)); token_getmad((yyvsp[-3].tkval),(yyval.opval),'o'); token_getmad((yyvsp[-2].tkval),(yyval.opval),'('); @@ -681,12 +688,13 @@ case 2: break; case 97: -#line 638 "madly.y" - { (yyvsp[0].opval) = newANONATTRSUB((yyvsp[-1].ival), 0, Nullop, (yyvsp[0].opval)); ;} +#line 646 "madly.y" + { SvREFCNT_inc(PL_compcv); + (yyvsp[0].opval) = newANONATTRSUB((yyvsp[-1].ival), 0, Nullop, (yyvsp[0].opval)); ;} break; case 98: -#line 640 "madly.y" +#line 649 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-2].opval), (yyvsp[0].opval)), (yyvsp[-4].opval))); @@ -694,7 +702,7 @@ case 2: break; case 101: -#line 655 "madly.y" +#line 664 "madly.y" { (yyval.opval) = newBINOP(OP_GELEM, 0, (yyvsp[-4].opval), scalar((yyvsp[-2].opval))); PL_expect = XOPERATOR; token_getmad((yyvsp[-3].tkval),(yyval.opval),'{'); @@ -704,7 +712,7 @@ case 2: break; case 102: -#line 662 "madly.y" +#line 671 "madly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((yyvsp[-3].opval)), scalar((yyvsp[-1].opval))); token_getmad((yyvsp[-2].tkval),(yyval.opval),'['); token_getmad((yyvsp[0].tkval),(yyval.opval),']'); @@ -712,7 +720,7 @@ case 2: break; case 103: -#line 667 "madly.y" +#line 676 "madly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((yyvsp[-4].opval)),OP_RV2AV), scalar((yyvsp[-1].opval))); @@ -723,7 +731,7 @@ case 2: break; case 104: -#line 675 "madly.y" +#line 684 "madly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((yyvsp[-3].opval)),OP_RV2AV), scalar((yyvsp[-1].opval))); @@ -733,7 +741,7 @@ case 2: break; case 105: -#line 682 "madly.y" +#line 691 "madly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((yyvsp[-4].opval)), jmaybe((yyvsp[-2].opval))); PL_expect = XOPERATOR; token_getmad((yyvsp[-3].tkval),(yyval.opval),'{'); @@ -743,7 +751,7 @@ case 2: break; case 106: -#line 689 "madly.y" +#line 698 "madly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((yyvsp[-5].opval)),OP_RV2HV), jmaybe((yyvsp[-2].opval))); @@ -756,7 +764,7 @@ case 2: break; case 107: -#line 699 "madly.y" +#line 708 "madly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((yyvsp[-4].opval)),OP_RV2HV), jmaybe((yyvsp[-2].opval))); @@ -768,7 +776,7 @@ case 2: break; case 108: -#line 708 "madly.y" +#line 717 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((yyvsp[-3].opval)))); token_getmad((yyvsp[-2].tkval),(yyval.opval),'a'); @@ -778,7 +786,7 @@ case 2: break; case 109: -#line 715 "madly.y" +#line 724 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), newCVREF(0, scalar((yyvsp[-4].opval))))); @@ -789,7 +797,7 @@ case 2: break; case 110: -#line 724 "madly.y" +#line 733 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), newCVREF(0, scalar((yyvsp[-3].opval))))); @@ -799,7 +807,7 @@ case 2: break; case 111: -#line 731 "madly.y" +#line 740 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((yyvsp[-2].opval)))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); @@ -808,7 +816,7 @@ case 2: break; case 112: -#line 737 "madly.y" +#line 746 "madly.y" { (yyval.opval) = newSLICEOP(0, (yyvsp[-1].opval), (yyvsp[-4].opval)); token_getmad((yyvsp[-5].tkval),(yyval.opval),'('); token_getmad((yyvsp[-3].tkval),(yyval.opval),')'); @@ -818,7 +826,7 @@ case 2: break; case 113: -#line 744 "madly.y" +#line 753 "madly.y" { (yyval.opval) = newSLICEOP(0, (yyvsp[-1].opval), Nullop); token_getmad((yyvsp[-4].tkval),(yyval.opval),'('); token_getmad((yyvsp[-3].tkval),(yyval.opval),')'); @@ -828,21 +836,21 @@ case 2: break; case 114: -#line 754 "madly.y" +#line 763 "madly.y" { (yyval.opval) = newASSIGNOP(OPf_STACKED, (yyvsp[-2].opval), ((yyvsp[-1].tkval))->tk_lval.ival, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 115: -#line 758 "madly.y" +#line 767 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 116: -#line 762 "madly.y" +#line 771 "madly.y" { if (((yyvsp[-1].tkval))->tk_lval.ival != OP_REPEAT) scalar((yyvsp[-2].opval)); (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, (yyvsp[-2].opval), scalar((yyvsp[0].opval))); @@ -851,49 +859,49 @@ case 2: break; case 117: -#line 768 "madly.y" +#line 777 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 118: -#line 772 "madly.y" +#line 781 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 119: -#line 776 "madly.y" +#line 785 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 120: -#line 780 "madly.y" +#line 789 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 121: -#line 784 "madly.y" +#line 793 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 122: -#line 788 "madly.y" +#line 797 "madly.y" { (yyval.opval) = newBINOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 123: -#line 792 "madly.y" +#line 801 "madly.y" { UNOP *op; (yyval.opval) = newRANGE(((yyvsp[-1].tkval))->tk_lval.ival, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); op = (UNOP*)(yyval.opval); @@ -905,28 +913,28 @@ case 2: break; case 124: -#line 801 "madly.y" +#line 810 "madly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 125: -#line 805 "madly.y" +#line 814 "madly.y" { (yyval.opval) = newLOGOP(OP_OR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 126: -#line 809 "madly.y" +#line 818 "madly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 127: -#line 813 "madly.y" +#line 822 "madly.y" { (yyval.opval) = bind_match(((yyvsp[-1].tkval))->tk_lval.ival, (yyvsp[-2].opval), (yyvsp[0].opval)); if ((yyval.opval)->op_type == OP_NOT) token_getmad((yyvsp[-1].tkval),((UNOP*)(yyval.opval))->op_first,'~'); @@ -936,35 +944,35 @@ case 2: break; case 128: -#line 823 "madly.y" +#line 832 "madly.y" { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 129: -#line 827 "madly.y" +#line 836 "madly.y" { (yyval.opval) = newUNOP(OP_NULL, 0, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'+'); ;} break; case 130: -#line 831 "madly.y" +#line 840 "madly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 131: -#line 835 "madly.y" +#line 844 "madly.y" { (yyval.opval) = newUNOP(OP_COMPLEMENT, 0, scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 132: -#line 839 "madly.y" +#line 848 "madly.y" { (yyval.opval) = newUNOP(OP_POSTINC, 0, mod(scalar((yyvsp[-1].opval)), OP_POSTINC)); token_getmad((yyvsp[0].tkval),(yyval.opval),'o'); @@ -972,7 +980,7 @@ case 2: break; case 133: -#line 844 "madly.y" +#line 853 "madly.y" { (yyval.opval) = newUNOP(OP_POSTDEC, 0, mod(scalar((yyvsp[-1].opval)), OP_POSTDEC)); token_getmad((yyvsp[0].tkval),(yyval.opval),'o'); @@ -980,7 +988,7 @@ case 2: break; case 134: -#line 849 "madly.y" +#line 858 "madly.y" { (yyval.opval) = newUNOP(OP_PREINC, 0, mod(scalar((yyvsp[0].opval)), OP_PREINC)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); @@ -988,7 +996,7 @@ case 2: break; case 135: -#line 854 "madly.y" +#line 863 "madly.y" { (yyval.opval) = newUNOP(OP_PREDEC, 0, mod(scalar((yyvsp[0].opval)), OP_PREDEC)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); @@ -996,7 +1004,7 @@ case 2: break; case 136: -#line 863 "madly.y" +#line 872 "madly.y" { (yyval.opval) = newANONLIST((yyvsp[-1].opval)); token_getmad((yyvsp[-2].tkval),(yyval.opval),'['); token_getmad((yyvsp[0].tkval),(yyval.opval),']'); @@ -1004,7 +1012,7 @@ case 2: break; case 137: -#line 868 "madly.y" +#line 877 "madly.y" { (yyval.opval) = newANONLIST(Nullop); token_getmad((yyvsp[-1].tkval),(yyval.opval),'['); token_getmad((yyvsp[0].tkval),(yyval.opval),']'); @@ -1012,7 +1020,7 @@ case 2: break; case 138: -#line 873 "madly.y" +#line 882 "madly.y" { (yyval.opval) = newANONHASH((yyvsp[-2].opval)); token_getmad((yyvsp[-3].tkval),(yyval.opval),'{'); token_getmad((yyvsp[-1].tkval),(yyval.opval),';'); @@ -1021,7 +1029,7 @@ case 2: break; case 139: -#line 879 "madly.y" +#line 888 "madly.y" { (yyval.opval) = newANONHASH(Nullop); token_getmad((yyvsp[-2].tkval),(yyval.opval),'{'); token_getmad((yyvsp[-1].tkval),(yyval.opval),';'); @@ -1030,8 +1038,9 @@ case 2: break; case 140: -#line 885 "madly.y" - { (yyval.opval) = newANONATTRSUB((yyvsp[-3].ival), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); +#line 894 "madly.y" + { SvREFCNT_inc(PL_compcv); + (yyval.opval) = newANONATTRSUB((yyvsp[-3].ival), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-4].tkval),(yyval.opval),'o'); op_getmad((yyvsp[-2].opval),(yyval.opval),'s'); op_getmad((yyvsp[-1].opval),(yyval.opval),'a'); @@ -1039,21 +1048,21 @@ case 2: break; case 141: -#line 895 "madly.y" +#line 905 "madly.y" { (yyval.opval) = dofile((yyvsp[0].opval), (yyvsp[-1].tkval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 142: -#line 899 "madly.y" +#line 909 "madly.y" { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, scope((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'D'); ;} break; case 143: -#line 903 "madly.y" +#line 913 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, @@ -1068,7 +1077,7 @@ case 2: break; case 144: -#line 915 "madly.y" +#line 925 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, append_elem(OP_LIST, @@ -1084,7 +1093,7 @@ case 2: break; case 145: -#line 928 "madly.y" +#line 938 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, scalar(newCVREF(0,scalar((yyvsp[-2].opval)))), Nullop)); dep(); @@ -1095,7 +1104,7 @@ case 2: break; case 146: -#line 936 "madly.y" +#line 946 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, (yyvsp[-1].opval), @@ -1107,7 +1116,7 @@ case 2: break; case 151: -#line 952 "madly.y" +#line 962 "madly.y" { (yyval.opval) = newCONDOP(0, (yyvsp[-4].opval), (yyvsp[-2].opval), (yyvsp[0].opval)); token_getmad((yyvsp[-3].tkval),(yyval.opval),'?'); token_getmad((yyvsp[-1].tkval),(yyval.opval),':'); @@ -1115,26 +1124,26 @@ case 2: break; case 152: -#line 957 "madly.y" +#line 967 "madly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, mod((yyvsp[0].opval),OP_REFGEN)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 153: -#line 961 "madly.y" +#line 971 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 154: -#line 963 "madly.y" +#line 973 "madly.y" { (yyval.opval) = localize((yyvsp[0].opval),((yyvsp[-1].tkval))->tk_lval.ival); token_getmad((yyvsp[-1].tkval),(yyval.opval),'d'); ;} break; case 155: -#line 967 "madly.y" +#line 977 "madly.y" { (yyval.opval) = sawparens(newUNOP(OP_NULL,0,(yyvsp[-1].opval))); token_getmad((yyvsp[-2].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1142,7 +1151,7 @@ case 2: break; case 156: -#line 972 "madly.y" +#line 982 "madly.y" { (yyval.opval) = sawparens(newNULLLIST()); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1150,37 +1159,37 @@ case 2: break; case 157: -#line 977 "madly.y" +#line 987 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 158: -#line 979 "madly.y" +#line 989 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 159: -#line 981 "madly.y" +#line 991 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 160: -#line 983 "madly.y" +#line 993 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 161: -#line 985 "madly.y" +#line 995 "madly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((yyvsp[0].opval), OP_AV2ARYLEN));;} break; case 162: -#line 987 "madly.y" +#line 997 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 163: -#line 989 "madly.y" +#line 999 "madly.y" { (yyval.opval) = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -1192,7 +1201,7 @@ case 2: break; case 164: -#line 998 "madly.y" +#line 1008 "madly.y" { (yyval.opval) = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -1206,17 +1215,17 @@ case 2: break; case 165: -#line 1009 "madly.y" +#line 1019 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 166: -#line 1011 "madly.y" +#line 1021 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((yyvsp[0].opval))); ;} break; case 167: -#line 1013 "madly.y" +#line 1023 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((yyvsp[-2].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1224,7 +1233,7 @@ case 2: break; case 168: -#line 1018 "madly.y" +#line 1028 "madly.y" { OP* op; (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), scalar((yyvsp[-3].opval)))); @@ -1238,7 +1247,7 @@ case 2: break; case 169: -#line 1029 "madly.y" +#line 1039 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[0].opval), scalar((yyvsp[-1].opval)))); token_getmad((yyvsp[-2].tkval),(yyval.opval),'o'); @@ -1246,7 +1255,7 @@ case 2: break; case 170: -#line 1034 "madly.y" +#line 1044 "madly.y" { (yyval.opval) = newOP(((yyvsp[0].tkval))->tk_lval.ival, OPf_SPECIAL); PL_hints |= HINT_BLOCK_SCOPE; token_getmad((yyvsp[0].tkval),(yyval.opval),'o'); @@ -1254,65 +1263,65 @@ case 2: break; case 171: -#line 1039 "madly.y" +#line 1049 "madly.y" { (yyval.opval) = newLOOPEX(((yyvsp[-1].tkval))->tk_lval.ival,(yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 172: -#line 1043 "madly.y" +#line 1053 "madly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((yyvsp[0].opval))); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 173: -#line 1047 "madly.y" +#line 1057 "madly.y" { (yyval.opval) = newOP(((yyvsp[0].tkval))->tk_lval.ival, 0); token_getmad((yyvsp[0].tkval),(yyval.opval),'o'); ;} break; case 174: -#line 1051 "madly.y" +#line 1061 "madly.y" { (yyval.opval) = newUNOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 175: -#line 1055 "madly.y" +#line 1065 "madly.y" { (yyval.opval) = newUNOP(((yyvsp[-1].tkval))->tk_lval.ival, 0, (yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'o'); ;} break; case 176: -#line 1059 "madly.y" +#line 1069 "madly.y" { (yyval.opval) = newOP(OP_REQUIRE, (yyvsp[0].tkval) ? OPf_SPECIAL : 0); ;} break; case 177: -#line 1061 "madly.y" +#line 1071 "madly.y" { (yyval.opval) = newUNOP(OP_REQUIRE, (yyvsp[-1].tkval) ? OPf_SPECIAL : 0, (yyvsp[0].opval)); ;} break; case 178: -#line 1063 "madly.y" +#line 1073 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[0].opval), scalar((yyvsp[-1].opval)))); ;} break; case 179: -#line 1066 "madly.y" +#line 1076 "madly.y" { (yyval.opval) = newOP(((yyvsp[0].tkval))->tk_lval.ival, 0); token_getmad((yyvsp[0].tkval),(yyval.opval),'o'); ;} break; case 180: -#line 1070 "madly.y" +#line 1080 "madly.y" { (yyval.opval) = newOP(((yyvsp[-2].tkval))->tk_lval.ival, 0); token_getmad((yyvsp[-2].tkval),(yyval.opval),'o'); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); @@ -1321,13 +1330,13 @@ case 2: break; case 181: -#line 1076 "madly.y" +#line 1086 "madly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((yyvsp[0].opval))); ;} break; case 182: -#line 1079 "madly.y" +#line 1089 "madly.y" { (yyval.opval) = newOP(((yyvsp[-2].tkval))->tk_lval.ival, OPf_SPECIAL); token_getmad((yyvsp[-2].tkval),(yyval.opval),'o'); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); @@ -1336,7 +1345,7 @@ case 2: break; case 183: -#line 1085 "madly.y" +#line 1095 "madly.y" { (yyval.opval) = newUNOP(((yyvsp[-3].tkval))->tk_lval.ival, 0, (yyvsp[-1].opval)); token_getmad((yyvsp[-3].tkval),(yyval.opval),'o'); token_getmad((yyvsp[-2].tkval),(yyval.opval),'('); @@ -1345,7 +1354,7 @@ case 2: break; case 184: -#line 1091 "madly.y" +#line 1101 "madly.y" { (yyval.opval) = pmruntime((yyvsp[-3].opval), (yyvsp[-1].opval), 1); token_getmad((yyvsp[-2].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1353,7 +1362,7 @@ case 2: break; case 187: -#line 1101 "madly.y" +#line 1111 "madly.y" { (yyval.opval) = my_attrs((yyvsp[-1].opval),(yyvsp[0].opval)); token_getmad((yyvsp[-2].tkval),(yyval.opval),'d'); append_madprops((yyvsp[0].opval)->op_madprop, (yyval.opval), 'a'); @@ -1362,14 +1371,14 @@ case 2: break; case 188: -#line 1107 "madly.y" +#line 1117 "madly.y" { (yyval.opval) = localize((yyvsp[0].opval),((yyvsp[-1].tkval))->tk_lval.ival); token_getmad((yyvsp[-1].tkval),(yyval.opval),'d'); ;} break; case 189: -#line 1114 "madly.y" +#line 1124 "madly.y" { (yyval.opval) = sawparens((yyvsp[-1].opval)); token_getmad((yyvsp[-2].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1377,7 +1386,7 @@ case 2: break; case 190: -#line 1119 "madly.y" +#line 1129 "madly.y" { (yyval.opval) = sawparens(newNULLLIST()); token_getmad((yyvsp[-1].tkval),(yyval.opval),'('); token_getmad((yyvsp[0].tkval),(yyval.opval),')'); @@ -1385,42 +1394,42 @@ case 2: break; case 191: -#line 1124 "madly.y" +#line 1134 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 192: -#line 1126 "madly.y" +#line 1136 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 193: -#line 1128 "madly.y" +#line 1138 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 194: -#line 1133 "madly.y" +#line 1143 "madly.y" { (yyval.opval) = Nullop; ;} break; case 195: -#line 1135 "madly.y" +#line 1145 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 196: -#line 1139 "madly.y" +#line 1149 "madly.y" { (yyval.opval) = Nullop; ;} break; case 197: -#line 1141 "madly.y" +#line 1151 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 198: -#line 1143 "madly.y" +#line 1153 "madly.y" { OP* op = newNULLLIST(); token_getmad((yyvsp[0].tkval),op,','); (yyval.opval) = append_elem(OP_LIST, (yyvsp[-1].opval), op); @@ -1428,69 +1437,69 @@ case 2: break; case 199: -#line 1152 "madly.y" +#line 1162 "madly.y" { PL_in_my = 0; (yyval.opval) = my((yyvsp[0].opval)); ;} break; case 200: -#line 1156 "madly.y" +#line 1166 "madly.y" { (yyval.opval) = newCVREF(((yyvsp[-1].tkval))->tk_lval.ival,(yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'&'); ;} break; case 201: -#line 1162 "madly.y" +#line 1172 "madly.y" { (yyval.opval) = newSVREF((yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'$'); ;} break; case 202: -#line 1168 "madly.y" +#line 1178 "madly.y" { (yyval.opval) = newAVREF((yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'@'); ;} break; case 203: -#line 1174 "madly.y" +#line 1184 "madly.y" { (yyval.opval) = newHVREF((yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'%'); ;} break; case 204: -#line 1180 "madly.y" +#line 1190 "madly.y" { (yyval.opval) = newAVREF((yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'l'); ;} break; case 205: -#line 1186 "madly.y" +#line 1196 "madly.y" { (yyval.opval) = newGVREF(0,(yyvsp[0].opval)); token_getmad((yyvsp[-1].tkval),(yyval.opval),'*'); ;} break; case 206: -#line 1193 "madly.y" +#line 1203 "madly.y" { (yyval.opval) = scalar((yyvsp[0].opval)); ;} break; case 207: -#line 1195 "madly.y" +#line 1205 "madly.y" { (yyval.opval) = scalar((yyvsp[0].opval)); ;} break; case 208: -#line 1197 "madly.y" +#line 1207 "madly.y" { (yyval.opval) = scope((yyvsp[0].opval)); ;} break; case 209: -#line 1200 "madly.y" +#line 1210 "madly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; diff --git a/madly.tab b/madly.tab index be4853e..2718be6 100644 --- a/madly.tab +++ b/madly.tab @@ -171,21 +171,21 @@ static const unsigned short int yyrline[] = 255, 266, 269, 275, 276, 283, 296, 308, 318, 328, 337, 362, 370, 380, 386, 387, 392, 395, 399, 404, 408, 412, 418, 421, 425, 427, 429, 431, 433, 435, - 439, 445, 453, 454, 458, 465, 480, 484, 488, 492, - 501, 502, 507, 508, 512, 519, 523, 530, 531, 536, - 544, 543, 555, 559, 563, 567, 571, 576, 582, 586, - 591, 598, 607, 613, 619, 627, 631, 638, 637, 647, - 648, 652, 661, 666, 674, 681, 688, 698, 707, 714, - 723, 730, 736, 743, 753, 757, 761, 767, 771, 775, - 779, 783, 787, 791, 800, 804, 808, 812, 822, 826, - 830, 834, 838, 843, 848, 853, 862, 867, 872, 878, - 884, 894, 898, 902, 914, 927, 935, 947, 948, 949, - 950, 951, 956, 960, 962, 966, 971, 976, 978, 980, - 982, 984, 986, 988, 997, 1008, 1010, 1012, 1017, 1028, - 1033, 1038, 1042, 1046, 1050, 1054, 1058, 1060, 1062, 1065, - 1069, 1075, 1078, 1084, 1090, 1095, 1096, 1100, 1106, 1113, - 1118, 1123, 1125, 1127, 1132, 1134, 1139, 1140, 1142, 1151, - 1155, 1161, 1167, 1173, 1179, 1185, 1192, 1194, 1196, 1199 + 439, 445, 454, 455, 459, 467, 483, 489, 494, 499, + 508, 509, 514, 515, 519, 526, 530, 537, 538, 543, + 551, 550, 563, 567, 571, 575, 579, 584, 590, 594, + 599, 606, 615, 621, 627, 635, 639, 646, 645, 656, + 657, 661, 670, 675, 683, 690, 697, 707, 716, 723, + 732, 739, 745, 752, 762, 766, 770, 776, 780, 784, + 788, 792, 796, 800, 809, 813, 817, 821, 831, 835, + 839, 843, 847, 852, 857, 862, 871, 876, 881, 887, + 893, 904, 908, 912, 924, 937, 945, 957, 958, 959, + 960, 961, 966, 970, 972, 976, 981, 986, 988, 990, + 992, 994, 996, 998, 1007, 1018, 1020, 1022, 1027, 1038, + 1043, 1048, 1052, 1056, 1060, 1064, 1068, 1070, 1072, 1075, + 1079, 1085, 1088, 1094, 1100, 1105, 1106, 1110, 1116, 1123, + 1128, 1133, 1135, 1137, 1142, 1144, 1149, 1150, 1152, 1161, + 1165, 1171, 1177, 1183, 1189, 1195, 1202, 1204, 1206, 1209 }; #endif diff --git a/madly.y b/madly.y index f10bf35..0643ff5 100644 --- a/madly.y +++ b/madly.y @@ -443,7 +443,8 @@ peg : PEG ; format : FORMAT startformsub formname block - { $$ = newFORM($2, $3, $4); + { SvREFCNT_inc(PL_compcv); + $$ = newFORM($2, $3, $4); prepend_madprops($1->tk_mad, $$, 'F'); $1->tk_mad = 0; token_free($1); @@ -456,14 +457,16 @@ formname: WORD { $$ = $1; } /* Unimplemented "my sub foo { }" */ mysubrout: MYSUB startsub subname proto subattrlist subbody - { $$ = newMYSUB($2, $3, $4, $5, $6); + { SvREFCNT_inc(PL_compcv); + $$ = newMYSUB($2, $3, $4, $5, $6); token_getmad($1,$$,'d'); } ; /* Subroutine definition */ subrout : SUB startsub subname proto subattrlist subbody - { OP* o = newSVOP(OP_ANONCODE, 0, + { SvREFCNT_inc(PL_compcv); + OP* o = newSVOP(OP_ANONCODE, 0, (SV*)newATTRSUB($2, $3, $4, $5, $6)); $$ = newOP(OP_NULL,0); op_getmad(o,$$,'&'); @@ -477,15 +480,19 @@ subrout : SUB startsub subname proto subattrlist subbody ; startsub: /* NULL */ /* start a regular subroutine scope */ - { $$ = start_subparse(FALSE, 0); } + { $$ = start_subparse(FALSE, 0); + SAVEFREESV(PL_compcv); } + ; startanonsub: /* NULL */ /* start an anonymous subroutine scope */ - { $$ = start_subparse(FALSE, CVf_ANON); } + { $$ = start_subparse(FALSE, CVf_ANON); + SAVEFREESV(PL_compcv); } ; startformsub: /* NULL */ /* start a format subroutine scope */ - { $$ = start_subparse(TRUE, 0); } + { $$ = start_subparse(TRUE, 0); + SAVEFREESV(PL_compcv); } ; /* Name of a subroutine - must be a bareword, could be special */ @@ -543,7 +550,8 @@ package : PACKAGE WORD ';' use : USE startsub { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ } WORD WORD listexpr ';' - { $$ = utilize(($1)->tk_lval.ival, $2, $4, $5, $6); + { SvREFCNT_inc(PL_compcv); + $$ = utilize(($1)->tk_lval.ival, $2, $4, $5, $6); token_getmad($1,$$,'o'); token_getmad($7,$$,';'); if (PL_rsfp_filters && AvFILLp(PL_rsfp_filters) >= 0) @@ -635,7 +643,8 @@ listop : LSTOP indirob argexpr /* print $fh @args */ token_getmad($4,$$,')'); } | LSTOPSUB startanonsub block /* map { foo } ... */ - { $3 = newANONATTRSUB($2, 0, Nullop, $3); } + { SvREFCNT_inc(PL_compcv); + $3 = newANONATTRSUB($2, 0, Nullop, $3); } listexpr %prec LSTOP /* ... @bar */ { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, @@ -882,7 +891,8 @@ anonymous: '[' expr ']' token_getmad($3,$$,'}'); } | ANONSUB startanonsub proto subattrlist block %prec '(' - { $$ = newANONATTRSUB($2, $3, $4, $5); + { SvREFCNT_inc(PL_compcv); + $$ = newANONATTRSUB($2, $3, $4, $5); token_getmad($1,$$,'o'); op_getmad($3,$$,'s'); op_getmad($4,$$,'a'); diff --git a/perly.act b/perly.act index 9e2acc6..e2b00cd 100644 --- a/perly.act +++ b/perly.act @@ -324,46 +324,52 @@ case 2: case 59: #line 344 "perly.y" - { newFORM((yyvsp[-2].ival), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} + { SvREFCNT_inc(PL_compcv); + newFORM((yyvsp[-2].ival), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} break; case 60: -#line 347 "perly.y" +#line 348 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 61: -#line 348 "perly.y" +#line 349 "perly.y" { (yyval.opval) = Nullop; ;} break; case 62: -#line 353 "perly.y" - { newMYSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} +#line 354 "perly.y" + { SvREFCNT_inc(PL_compcv); + newMYSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} break; case 63: -#line 358 "perly.y" - { newATTRSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} +#line 360 "perly.y" + { SvREFCNT_inc(PL_compcv); + newATTRSUB((yyvsp[-4].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} break; case 64: -#line 362 "perly.y" - { (yyval.ival) = start_subparse(FALSE, 0); ;} +#line 365 "perly.y" + { (yyval.ival) = start_subparse(FALSE, 0); + SAVEFREESV(PL_compcv); ;} break; case 65: -#line 366 "perly.y" - { (yyval.ival) = start_subparse(FALSE, CVf_ANON); ;} +#line 370 "perly.y" + { (yyval.ival) = start_subparse(FALSE, CVf_ANON); + SAVEFREESV(PL_compcv); ;} break; case 66: -#line 370 "perly.y" - { (yyval.ival) = start_subparse(TRUE, 0); ;} +#line 375 "perly.y" + { (yyval.ival) = start_subparse(TRUE, 0); + SAVEFREESV(PL_compcv); ;} break; case 67: -#line 374 "perly.y" +#line 380 "perly.y" { const char *const name = SvPV_nolen_const(((SVOP*)(yyvsp[0].opval))->op_sv); if (strEQ(name, "BEGIN") || strEQ(name, "END") || strEQ(name, "INIT") || strEQ(name, "CHECK")) @@ -372,99 +378,100 @@ case 2: break; case 68: -#line 383 "perly.y" +#line 389 "perly.y" { (yyval.opval) = Nullop; ;} break; case 70: -#line 389 "perly.y" +#line 395 "perly.y" { (yyval.opval) = Nullop; ;} break; case 71: -#line 391 "perly.y" +#line 397 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 72: -#line 393 "perly.y" +#line 399 "perly.y" { (yyval.opval) = Nullop; ;} break; case 73: -#line 398 "perly.y" +#line 404 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 74: -#line 400 "perly.y" +#line 406 "perly.y" { (yyval.opval) = Nullop; ;} break; case 75: -#line 404 "perly.y" +#line 410 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 76: -#line 405 "perly.y" +#line 411 "perly.y" { (yyval.opval) = Nullop; PL_expect = XSTATE; ;} break; case 77: -#line 409 "perly.y" +#line 415 "perly.y" { package((yyvsp[-1].opval)); ;} break; case 78: -#line 413 "perly.y" +#line 419 "perly.y" { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ ;} break; case 79: -#line 415 "perly.y" - { utilize((yyvsp[-6].ival), (yyvsp[-5].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval)); ;} +#line 421 "perly.y" + { SvREFCNT_inc(PL_compcv); + utilize((yyvsp[-6].ival), (yyvsp[-5].ival), (yyvsp[-3].opval), (yyvsp[-2].opval), (yyvsp[-1].opval)); ;} break; case 80: -#line 420 "perly.y" +#line 427 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 81: -#line 422 "perly.y" +#line 429 "perly.y" { (yyval.opval) = newLOGOP((yyvsp[-1].ival), 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 82: -#line 424 "perly.y" +#line 431 "perly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 84: -#line 430 "perly.y" +#line 437 "perly.y" { (yyval.opval) = (yyvsp[-1].opval); ;} break; case 85: -#line 432 "perly.y" +#line 439 "perly.y" { (yyval.opval) = append_elem(OP_LIST, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 87: -#line 438 "perly.y" +#line 445 "perly.y" { (yyval.opval) = convert((yyvsp[-2].ival), OPf_STACKED, prepend_elem(OP_LIST, newGVREF((yyvsp[-2].ival),(yyvsp[-1].opval)), (yyvsp[0].opval)) ); ;} break; case 88: -#line 441 "perly.y" +#line 448 "perly.y" { (yyval.opval) = convert((yyvsp[-4].ival), OPf_STACKED, prepend_elem(OP_LIST, newGVREF((yyvsp[-4].ival),(yyvsp[-2].opval)), (yyvsp[-1].opval)) ); ;} break; case 89: -#line 444 "perly.y" +#line 451 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, scalar((yyvsp[-5].opval)), (yyvsp[-1].opval)), @@ -472,14 +479,14 @@ case 2: break; case 90: -#line 449 "perly.y" +#line 456 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, scalar((yyvsp[-2].opval)), newUNOP(OP_METHOD, 0, (yyvsp[0].opval)))); ;} break; case 91: -#line 453 "perly.y" +#line 460 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-1].opval), (yyvsp[0].opval)), @@ -487,7 +494,7 @@ case 2: break; case 92: -#line 458 "perly.y" +#line 465 "perly.y" { (yyval.opval) = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-3].opval), (yyvsp[-1].opval)), @@ -495,60 +502,61 @@ case 2: break; case 93: -#line 463 "perly.y" +#line 470 "perly.y" { (yyval.opval) = convert((yyvsp[-1].ival), 0, (yyvsp[0].opval)); ;} break; case 94: -#line 465 "perly.y" +#line 472 "perly.y" { (yyval.opval) = convert((yyvsp[-3].ival), 0, (yyvsp[-1].opval)); ;} break; case 95: -#line 467 "perly.y" - { (yyvsp[0].opval) = newANONATTRSUB((yyvsp[-1].ival), 0, Nullop, (yyvsp[0].opval)); ;} +#line 474 "perly.y" + { SvREFCNT_inc(PL_compcv); + (yyvsp[0].opval) = newANONATTRSUB((yyvsp[-1].ival), 0, Nullop, (yyvsp[0].opval)); ;} break; case 96: -#line 469 "perly.y" +#line 477 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, (yyvsp[-2].opval), (yyvsp[0].opval)), (yyvsp[-4].opval))); ;} break; case 99: -#line 483 "perly.y" +#line 491 "perly.y" { (yyval.opval) = newBINOP(OP_GELEM, 0, (yyvsp[-4].opval), scalar((yyvsp[-2].opval))); PL_expect = XOPERATOR; ;} break; case 100: -#line 486 "perly.y" +#line 494 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((yyvsp[-3].opval)), scalar((yyvsp[-1].opval))); ;} break; case 101: -#line 488 "perly.y" +#line 496 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((yyvsp[-4].opval)),OP_RV2AV), scalar((yyvsp[-1].opval)));;} break; case 102: -#line 492 "perly.y" +#line 500 "perly.y" { (yyval.opval) = newBINOP(OP_AELEM, 0, ref(newAVREF((yyvsp[-3].opval)),OP_RV2AV), scalar((yyvsp[-1].opval)));;} break; case 103: -#line 496 "perly.y" +#line 504 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((yyvsp[-4].opval)), jmaybe((yyvsp[-2].opval))); PL_expect = XOPERATOR; ;} break; case 104: -#line 499 "perly.y" +#line 507 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((yyvsp[-5].opval)),OP_RV2HV), jmaybe((yyvsp[-2].opval))); @@ -556,7 +564,7 @@ case 2: break; case 105: -#line 504 "perly.y" +#line 512 "perly.y" { (yyval.opval) = newBINOP(OP_HELEM, 0, ref(newHVREF((yyvsp[-4].opval)),OP_RV2HV), jmaybe((yyvsp[-2].opval))); @@ -564,194 +572,195 @@ case 2: break; case 106: -#line 509 "perly.y" +#line 517 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((yyvsp[-3].opval)))); ;} break; case 107: -#line 512 "perly.y" +#line 520 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), newCVREF(0, scalar((yyvsp[-4].opval))))); ;} break; case 108: -#line 517 "perly.y" +#line 525 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), newCVREF(0, scalar((yyvsp[-3].opval))))); ;} break; case 109: -#line 521 "perly.y" +#line 529 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, newCVREF(0, scalar((yyvsp[-2].opval)))); ;} break; case 110: -#line 524 "perly.y" +#line 532 "perly.y" { (yyval.opval) = newSLICEOP(0, (yyvsp[-1].opval), (yyvsp[-4].opval)); ;} break; case 111: -#line 526 "perly.y" +#line 534 "perly.y" { (yyval.opval) = newSLICEOP(0, (yyvsp[-1].opval), Nullop); ;} break; case 112: -#line 531 "perly.y" +#line 539 "perly.y" { (yyval.opval) = newASSIGNOP(OPf_STACKED, (yyvsp[-2].opval), (yyvsp[-1].ival), (yyvsp[0].opval)); ;} break; case 113: -#line 533 "perly.y" +#line 541 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 114: -#line 535 "perly.y" +#line 543 "perly.y" { if ((yyvsp[-1].ival) != OP_REPEAT) scalar((yyvsp[-2].opval)); (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, (yyvsp[-2].opval), scalar((yyvsp[0].opval))); ;} break; case 115: -#line 539 "perly.y" +#line 547 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 116: -#line 541 "perly.y" +#line 549 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 117: -#line 543 "perly.y" +#line 551 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 118: -#line 545 "perly.y" +#line 553 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 119: -#line 547 "perly.y" +#line 555 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 120: -#line 549 "perly.y" +#line 557 "perly.y" { (yyval.opval) = newBINOP((yyvsp[-1].ival), 0, scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval))); ;} break; case 121: -#line 551 "perly.y" +#line 559 "perly.y" { (yyval.opval) = newRANGE((yyvsp[-1].ival), scalar((yyvsp[-2].opval)), scalar((yyvsp[0].opval)));;} break; case 122: -#line 553 "perly.y" +#line 561 "perly.y" { (yyval.opval) = newLOGOP(OP_AND, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 123: -#line 555 "perly.y" +#line 563 "perly.y" { (yyval.opval) = newLOGOP(OP_OR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 124: -#line 557 "perly.y" +#line 565 "perly.y" { (yyval.opval) = newLOGOP(OP_DOR, 0, (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 125: -#line 559 "perly.y" +#line 567 "perly.y" { (yyval.opval) = bind_match((yyvsp[-1].ival), (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 126: -#line 564 "perly.y" +#line 572 "perly.y" { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((yyvsp[0].opval))); ;} break; case 127: -#line 566 "perly.y" +#line 574 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 128: -#line 568 "perly.y" +#line 576 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((yyvsp[0].opval))); ;} break; case 129: -#line 570 "perly.y" +#line 578 "perly.y" { (yyval.opval) = newUNOP(OP_COMPLEMENT, 0, scalar((yyvsp[0].opval)));;} break; case 130: -#line 572 "perly.y" +#line 580 "perly.y" { (yyval.opval) = newUNOP(OP_POSTINC, 0, mod(scalar((yyvsp[-1].opval)), OP_POSTINC)); ;} break; case 131: -#line 575 "perly.y" +#line 583 "perly.y" { (yyval.opval) = newUNOP(OP_POSTDEC, 0, mod(scalar((yyvsp[-1].opval)), OP_POSTDEC)); ;} break; case 132: -#line 578 "perly.y" +#line 586 "perly.y" { (yyval.opval) = newUNOP(OP_PREINC, 0, mod(scalar((yyvsp[0].opval)), OP_PREINC)); ;} break; case 133: -#line 581 "perly.y" +#line 589 "perly.y" { (yyval.opval) = newUNOP(OP_PREDEC, 0, mod(scalar((yyvsp[0].opval)), OP_PREDEC)); ;} break; case 134: -#line 588 "perly.y" +#line 596 "perly.y" { (yyval.opval) = newANONLIST((yyvsp[-1].opval)); ;} break; case 135: -#line 590 "perly.y" +#line 598 "perly.y" { (yyval.opval) = newANONLIST(Nullop); ;} break; case 136: -#line 592 "perly.y" +#line 600 "perly.y" { (yyval.opval) = newANONHASH((yyvsp[-2].opval)); ;} break; case 137: -#line 594 "perly.y" +#line 602 "perly.y" { (yyval.opval) = newANONHASH(Nullop); ;} break; case 138: -#line 596 "perly.y" - { (yyval.opval) = newANONATTRSUB((yyvsp[-3].ival), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} +#line 604 "perly.y" + { SvREFCNT_inc(PL_compcv); + (yyval.opval) = newANONATTRSUB((yyvsp[-3].ival), (yyvsp[-2].opval), (yyvsp[-1].opval), (yyvsp[0].opval)); ;} break; case 139: -#line 602 "perly.y" +#line 611 "perly.y" { (yyval.opval) = dofile((yyvsp[0].opval), (yyvsp[-1].ival)); ;} break; case 140: -#line 604 "perly.y" +#line 613 "perly.y" { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, scope((yyvsp[0].opval))); ;} break; case 141: -#line 606 "perly.y" +#line 615 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, @@ -762,7 +771,7 @@ case 2: break; case 142: -#line 614 "perly.y" +#line 623 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, append_elem(OP_LIST, @@ -774,14 +783,14 @@ case 2: break; case 143: -#line 623 "perly.y" +#line 632 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, scalar(newCVREF(0,scalar((yyvsp[-2].opval)))), Nullop)); dep();;} break; case 144: -#line 627 "perly.y" +#line 636 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, (yyvsp[-1].opval), @@ -789,67 +798,67 @@ case 2: break; case 149: -#line 639 "perly.y" +#line 648 "perly.y" { (yyval.opval) = newCONDOP(0, (yyvsp[-4].opval), (yyvsp[-2].opval), (yyvsp[0].opval)); ;} break; case 150: -#line 641 "perly.y" +#line 650 "perly.y" { (yyval.opval) = newUNOP(OP_REFGEN, 0, mod((yyvsp[0].opval),OP_REFGEN)); ;} break; case 151: -#line 643 "perly.y" +#line 652 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 152: -#line 645 "perly.y" +#line 654 "perly.y" { (yyval.opval) = localize((yyvsp[0].opval),(yyvsp[-1].ival)); ;} break; case 153: -#line 647 "perly.y" +#line 656 "perly.y" { (yyval.opval) = sawparens((yyvsp[-1].opval)); ;} break; case 154: -#line 649 "perly.y" +#line 658 "perly.y" { (yyval.opval) = sawparens(newNULLLIST()); ;} break; case 155: -#line 651 "perly.y" +#line 660 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 156: -#line 653 "perly.y" +#line 662 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 157: -#line 655 "perly.y" +#line 664 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 158: -#line 657 "perly.y" +#line 666 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 159: -#line 659 "perly.y" +#line 668 "perly.y" { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((yyvsp[0].opval), OP_AV2ARYLEN));;} break; case 160: -#line 661 "perly.y" +#line 670 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 161: -#line 663 "perly.y" +#line 672 "perly.y" { (yyval.opval) = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -858,7 +867,7 @@ case 2: break; case 162: -#line 669 "perly.y" +#line 678 "perly.y" { (yyval.opval) = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -868,223 +877,223 @@ case 2: break; case 163: -#line 676 "perly.y" +#line 685 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 164: -#line 678 "perly.y" +#line 687 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, 0, scalar((yyvsp[0].opval))); ;} break; case 165: -#line 680 "perly.y" +#line 689 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((yyvsp[-2].opval))); ;} break; case 166: -#line 682 "perly.y" +#line 691 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[-1].opval), scalar((yyvsp[-3].opval)))); ;} break; case 167: -#line 685 "perly.y" +#line 694 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[0].opval), scalar((yyvsp[-1].opval)))); ;} break; case 168: -#line 688 "perly.y" +#line 697 "perly.y" { (yyval.opval) = newOP((yyvsp[0].ival), OPf_SPECIAL); PL_hints |= HINT_BLOCK_SCOPE; ;} break; case 169: -#line 691 "perly.y" +#line 700 "perly.y" { (yyval.opval) = newLOOPEX((yyvsp[-1].ival),(yyvsp[0].opval)); ;} break; case 170: -#line 693 "perly.y" +#line 702 "perly.y" { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((yyvsp[0].opval))); ;} break; case 171: -#line 695 "perly.y" +#line 704 "perly.y" { (yyval.opval) = newOP((yyvsp[0].ival), 0); ;} break; case 172: -#line 697 "perly.y" +#line 706 "perly.y" { (yyval.opval) = newUNOP((yyvsp[-1].ival), 0, (yyvsp[0].opval)); ;} break; case 173: -#line 699 "perly.y" +#line 708 "perly.y" { (yyval.opval) = newUNOP((yyvsp[-1].ival), 0, (yyvsp[0].opval)); ;} break; case 174: -#line 701 "perly.y" +#line 710 "perly.y" { (yyval.opval) = newOP(OP_REQUIRE, (yyvsp[0].ival) ? OPf_SPECIAL : 0); ;} break; case 175: -#line 703 "perly.y" +#line 712 "perly.y" { (yyval.opval) = newUNOP(OP_REQUIRE, (yyvsp[-1].ival) ? OPf_SPECIAL : 0, (yyvsp[0].opval)); ;} break; case 176: -#line 705 "perly.y" +#line 714 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, (yyvsp[0].opval), scalar((yyvsp[-1].opval)))); ;} break; case 177: -#line 708 "perly.y" +#line 717 "perly.y" { (yyval.opval) = newOP((yyvsp[0].ival), 0); ;} break; case 178: -#line 710 "perly.y" +#line 719 "perly.y" { (yyval.opval) = newOP((yyvsp[-2].ival), 0); ;} break; case 179: -#line 712 "perly.y" +#line 721 "perly.y" { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar((yyvsp[0].opval))); ;} break; case 180: -#line 715 "perly.y" +#line 724 "perly.y" { (yyval.opval) = (yyvsp[-2].ival) == OP_NOT ? newUNOP((yyvsp[-2].ival), 0, newSVOP(OP_CONST, 0, newSViv(0))) : newOP((yyvsp[-2].ival), OPf_SPECIAL); ;} break; case 181: -#line 718 "perly.y" +#line 727 "perly.y" { (yyval.opval) = newUNOP((yyvsp[-3].ival), 0, (yyvsp[-1].opval)); ;} break; case 182: -#line 720 "perly.y" +#line 729 "perly.y" { (yyval.opval) = pmruntime((yyvsp[-3].opval), (yyvsp[-1].opval), 1); ;} break; case 185: -#line 727 "perly.y" +#line 736 "perly.y" { (yyval.opval) = my_attrs((yyvsp[-1].opval),(yyvsp[0].opval)); ;} break; case 186: -#line 729 "perly.y" +#line 738 "perly.y" { (yyval.opval) = localize((yyvsp[0].opval),(yyvsp[-1].ival)); ;} break; case 187: -#line 734 "perly.y" +#line 743 "perly.y" { (yyval.opval) = sawparens((yyvsp[-1].opval)); ;} break; case 188: -#line 736 "perly.y" +#line 745 "perly.y" { (yyval.opval) = sawparens(newNULLLIST()); ;} break; case 189: -#line 738 "perly.y" +#line 747 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 190: -#line 740 "perly.y" +#line 749 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 191: -#line 742 "perly.y" +#line 751 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 192: -#line 747 "perly.y" +#line 756 "perly.y" { (yyval.opval) = Nullop; ;} break; case 193: -#line 749 "perly.y" +#line 758 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 194: -#line 753 "perly.y" +#line 762 "perly.y" { (yyval.opval) = Nullop; ;} break; case 195: -#line 755 "perly.y" +#line 764 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; case 196: -#line 757 "perly.y" +#line 766 "perly.y" { (yyval.opval) = (yyvsp[-1].opval); ;} break; case 197: -#line 763 "perly.y" +#line 772 "perly.y" { PL_in_my = 0; (yyval.opval) = my((yyvsp[0].opval)); ;} break; case 198: -#line 767 "perly.y" +#line 776 "perly.y" { (yyval.opval) = newCVREF((yyvsp[-1].ival),(yyvsp[0].opval)); ;} break; case 199: -#line 771 "perly.y" +#line 780 "perly.y" { (yyval.opval) = newSVREF((yyvsp[0].opval)); ;} break; case 200: -#line 775 "perly.y" +#line 784 "perly.y" { (yyval.opval) = newAVREF((yyvsp[0].opval)); ;} break; case 201: -#line 779 "perly.y" +#line 788 "perly.y" { (yyval.opval) = newHVREF((yyvsp[0].opval)); ;} break; case 202: -#line 783 "perly.y" +#line 792 "perly.y" { (yyval.opval) = newAVREF((yyvsp[0].opval)); ;} break; case 203: -#line 787 "perly.y" +#line 796 "perly.y" { (yyval.opval) = newGVREF(0,(yyvsp[0].opval)); ;} break; case 204: -#line 792 "perly.y" +#line 801 "perly.y" { (yyval.opval) = scalar((yyvsp[0].opval)); ;} break; case 205: -#line 794 "perly.y" +#line 803 "perly.y" { (yyval.opval) = scalar((yyvsp[0].opval)); ;} break; case 206: -#line 796 "perly.y" +#line 805 "perly.y" { (yyval.opval) = scope((yyvsp[0].opval)); ;} break; case 207: -#line 799 "perly.y" +#line 808 "perly.y" { (yyval.opval) = (yyvsp[0].opval); ;} break; diff --git a/perly.tab b/perly.tab index 5c7e678..18c1624 100644 --- a/perly.tab +++ b/perly.tab @@ -171,21 +171,21 @@ static const unsigned short int yyrline[] = 212, 219, 222, 228, 229, 234, 240, 246, 249, 253, 256, 273, 280, 290, 296, 297, 302, 303, 307, 312, 316, 320, 326, 327, 331, 333, 335, 337, 339, 343, - 347, 348, 352, 357, 362, 366, 370, 374, 383, 384, - 389, 390, 392, 397, 399, 404, 405, 408, 413, 412, - 419, 421, 423, 425, 429, 431, 433, 437, 440, 443, - 448, 452, 457, 462, 464, 467, 466, 475, 476, 480, - 485, 487, 491, 495, 498, 503, 508, 511, 516, 520, - 523, 525, 530, 532, 534, 538, 540, 542, 544, 546, - 548, 550, 552, 554, 556, 558, 563, 565, 567, 569, - 571, 574, 577, 580, 587, 589, 591, 593, 595, 601, - 603, 605, 613, 622, 626, 634, 635, 636, 637, 638, - 640, 642, 644, 646, 648, 650, 652, 654, 656, 658, - 660, 662, 668, 675, 677, 679, 681, 684, 687, 690, - 692, 694, 696, 698, 700, 702, 704, 707, 709, 711, - 714, 717, 719, 721, 722, 726, 728, 733, 735, 737, - 739, 741, 746, 748, 753, 754, 756, 762, 766, 770, - 774, 778, 782, 786, 791, 793, 795, 798 + 348, 349, 353, 359, 365, 370, 375, 380, 389, 390, + 395, 396, 398, 403, 405, 410, 411, 414, 419, 418, + 426, 428, 430, 432, 436, 438, 440, 444, 447, 450, + 455, 459, 464, 469, 471, 474, 473, 483, 484, 488, + 493, 495, 499, 503, 506, 511, 516, 519, 524, 528, + 531, 533, 538, 540, 542, 546, 548, 550, 552, 554, + 556, 558, 560, 562, 564, 566, 571, 573, 575, 577, + 579, 582, 585, 588, 595, 597, 599, 601, 603, 610, + 612, 614, 622, 631, 635, 643, 644, 645, 646, 647, + 649, 651, 653, 655, 657, 659, 661, 663, 665, 667, + 669, 671, 677, 684, 686, 688, 690, 693, 696, 699, + 701, 703, 705, 707, 709, 711, 713, 716, 718, 720, + 723, 726, 728, 730, 731, 735, 737, 742, 744, 746, + 748, 750, 755, 757, 762, 763, 765, 771, 775, 779, + 783, 787, 791, 795, 800, 802, 804, 807 }; #endif diff --git a/perly.y b/perly.y index cbd2f7a..0ae38d5 100644 --- a/perly.y +++ b/perly.y @@ -341,7 +341,8 @@ decl : format ; format : FORMAT startformsub formname block - { newFORM($2, $3, $4); } + { SvREFCNT_inc(PL_compcv); + newFORM($2, $3, $4); } ; formname: WORD { $$ = $1; } @@ -350,24 +351,29 @@ formname: WORD { $$ = $1; } /* Unimplemented "my sub foo { }" */ mysubrout: MYSUB startsub subname proto subattrlist subbody - { newMYSUB($2, $3, $4, $5, $6); } + { SvREFCNT_inc(PL_compcv); + newMYSUB($2, $3, $4, $5, $6); } ; /* Subroutine definition */ subrout : SUB startsub subname proto subattrlist subbody - { newATTRSUB($2, $3, $4, $5, $6); } + { SvREFCNT_inc(PL_compcv); + newATTRSUB($2, $3, $4, $5, $6); } ; startsub: /* NULL */ /* start a regular subroutine scope */ - { $$ = start_subparse(FALSE, 0); } + { $$ = start_subparse(FALSE, 0); + SAVEFREESV(PL_compcv); } ; startanonsub: /* NULL */ /* start an anonymous subroutine scope */ - { $$ = start_subparse(FALSE, CVf_ANON); } + { $$ = start_subparse(FALSE, CVf_ANON); + SAVEFREESV(PL_compcv); } ; startformsub: /* NULL */ /* start a format subroutine scope */ - { $$ = start_subparse(TRUE, 0); } + { $$ = start_subparse(TRUE, 0); + SAVEFREESV(PL_compcv); } ; /* Name of a subroutine - must be a bareword, could be special */ @@ -412,7 +418,8 @@ package : PACKAGE WORD ';' use : USE startsub { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ } WORD WORD listexpr ';' - { utilize($1, $2, $4, $5, $6); } + { SvREFCNT_inc(PL_compcv); + utilize($1, $2, $4, $5, $6); } ; /* Ordinary expressions; logical combinations */ @@ -464,7 +471,8 @@ listop : LSTOP indirob argexpr /* map {...} @args or print $fh @args */ | FUNC '(' listexprcom ')' /* print (@args) */ { $$ = convert($1, 0, $3); } | LSTOPSUB startanonsub block /* sub f(&@); f { foo } ... */ - { $3 = newANONATTRSUB($2, 0, Nullop, $3); } + { SvREFCNT_inc(PL_compcv); + $3 = newANONATTRSUB($2, 0, Nullop, $3); } listexpr %prec LSTOP /* ... @bar */ { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, @@ -593,7 +601,8 @@ anonymous: '[' expr ']' | HASHBRACK ';' '}' %prec '(' /* { } (';' by tokener) */ { $$ = newANONHASH(Nullop); } | ANONSUB startanonsub proto subattrlist block %prec '(' - { $$ = newANONATTRSUB($2, $3, $4, $5); } + { SvREFCNT_inc(PL_compcv); + $$ = newANONATTRSUB($2, $3, $4, $5); } ;