From: Perl 5 Porters Date: Thu, 16 Jan 1997 20:39:00 +0000 (+1200) Subject: [inseparable changes from patch from perl5.003_21 to perl5.003_22] X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fa83b5b6263413f922909c255e021c32c808b32d;p=p5sagit%2Fp5-mst-13.2.git [inseparable changes from patch from perl5.003_21 to perl5.003_22] CORE LANGUAGE CHANGES Subject: Fix parsing of C< ${ xyz } > From: Chip Salzenberg Files: toke.c Subject: Don't parse method calls in strings From: Chip Salzenberg Files: toke.c OTHER CORE CHANGES Subject: Fix memory corruption from formats From: Chip Salzenberg Files: op.c perl.c perly.c perly.c.diff perly.y proto.h sv.c toke.c --- diff --git a/Changes b/Changes index 8449c36..f5729bc 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,82 @@ releases.) ---------------- +Version 5.003_22 +---------------- + +This release is primarily made up of bug fixes, the foremost among +which repairs a showstopper memory corruption bug in formats. + + CORE LANGUAGE CHANGES + + Title: "Fix parsing of C< ${ xyz } >" + From: Chip Salzenberg + Files: toke.c + + Title: "Don't parse method calls in strings" + From: Chip Salzenberg + Files: toke.c + + Title: "Fix overly picky carping about leading '{' in regex" + From: Chip Salzenberg + Files: regcomp.c + + OTHER CORE CHANGES + + Title: "Fix memory corruption from formats" + From: Chip Salzenberg + Files: op.c perl.c perly.c perly.c.diff perly.y proto.h sv.c toke.c + + BUILD PROCESS + + Title: "Fix '_mopop' typo" + From: Chip Salzenberg + Files: Makefile.SH + + LIBRARY AND EXTENSIONS + + Title: "Gut IO::Handle::DESTROY" + From: Chip Salzenberg + Files: ext/IO/lib/IO/Handle.pm + + Title: "RiscOS is case-insensitive" + From: Chip Salzenberg + Files: lib/File/Basename.pm + + TESTS + + Title: "Fix thinko in db-recno.t" + From: Chip Salzenberg + Files: t/lib/db-recno.t + + UTILITIES + + Title: "Make perlbug more cautionary and more verbose" + From: Kenneth Albanowski and Jarkko Hietaniemi + Files: utils/perlbug.PL + + DOCUMENTATION + + Title: "NEW roffitall + INSTALL fix" + From: Raphael Manfredi + Msg-ID: <6058.853410121@lyon.grenoble.hp.com> + Date: Thu, 16 Jan 97 11:22:01 +0100 + Files: INSTALL pod/roffitall + + Title: "srand() doc update" + From: Roderick Schertler + Msg-ID: <24195.853379065@eeyore.ibcinc.com> + Date: Wed, 15 Jan 1997 20:44:25 -0500 + Files: pod/perlfunc.pod + + Title: "documentation of configpm (perl5.003_20)" + From: win@in.rhein-main.de (Winfried Koenig) + Msg-ID: + Date: Wed, 15 Jan 1997 14:03:27 +0200 (EET) + Files: configpm + + +---------------- Version 5.003_21 ---------------- diff --git a/op.c b/op.c index 3468310..e0393bf 100644 --- a/op.c +++ b/op.c @@ -2894,7 +2894,7 @@ CV* outside; SAVESPTR(compcv); cv = compcv = (CV*)NEWSV(1104,0); - sv_upgrade((SV *)cv, SVt_PVCV); + sv_upgrade((SV *)cv, SvTYPE(proto)); CvCLONED_on(cv); if (CvANON(proto)) CvANON_on(cv); @@ -3310,7 +3310,6 @@ OP *block; CvSTART(cv) = LINKLIST(CvROOT(cv)); CvROOT(cv)->op_next = 0; peep(CvSTART(cv)); - FmLINES(cv) = 0; op_free(op); copline = NOLINE; LEAVE_SCOPE(floor); diff --git a/patchlevel.h b/patchlevel.h index 529bcbd..d43d803 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -1,5 +1,5 @@ #define PATCHLEVEL 3 -#define SUBVERSION 21 +#define SUBVERSION 22 /* local_patches -- list of locally applied less-than-subversion patches. diff --git a/perl.c b/perl.c index 8cb8169..d6f055d 100644 --- a/perl.c +++ b/perl.c @@ -881,7 +881,7 @@ I32 create; { GV* gv = gv_fetchpv(name, create, SVt_PVCV); if (create && !GvCVu(gv)) - return newSUB(start_subparse(), + return newSUB(start_subparse(0), newSVOP(OP_CONST, 0, newSVpv(name,0)), Nullop, Nullop); diff --git a/perly.c b/perly.c index f8a1668..6de75e5 100644 --- a/perly.c +++ b/perly.c @@ -1239,7 +1239,7 @@ int yyerrflag; int yychar; YYSTYPE yyval; YYSTYPE yylval; -#line 626 "perly.y" +#line 624 "perly.y" /* PROGRAM */ #line 1315 "perly.c" #define YYABORT goto yyabort @@ -1706,317 +1706,315 @@ case 52: break; case 53: #line 280 "perly.y" -{ yyval.ival = start_subparse(); } +{ yyval.ival = start_subparse(0); } break; case 54: #line 284 "perly.y" -{ yyval.ival = start_subparse(); - CvANON_on(compcv); } +{ yyval.ival = start_subparse(CVf_ANON); } break; case 55: -#line 289 "perly.y" -{ yyval.ival = start_subparse(); - CvFORMAT_on(compcv); } +#line 288 "perly.y" +{ yyval.ival = start_subparse(CVf_FORMAT); } break; case 56: -#line 293 "perly.y" +#line 291 "perly.y" { char *name = SvPVx(((SVOP*)yyvsp[0].opval)->op_sv, na); if (strEQ(name, "BEGIN") || strEQ(name, "END")) CvUNIQUE_on(compcv); yyval.opval = yyvsp[0].opval; } break; case 57: -#line 300 "perly.y" +#line 298 "perly.y" { yyval.opval = Nullop; } break; case 59: -#line 304 "perly.y" +#line 302 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 60: -#line 305 "perly.y" +#line 303 "perly.y" { yyval.opval = Nullop; expect = XSTATE; } break; case 61: -#line 309 "perly.y" +#line 307 "perly.y" { package(yyvsp[-1].opval); } break; case 62: -#line 311 "perly.y" +#line 309 "perly.y" { package(Nullop); } break; case 63: -#line 315 "perly.y" +#line 313 "perly.y" { CvUNIQUE_on(compcv); /* It's a BEGIN {} */ } break; case 64: -#line 317 "perly.y" +#line 315 "perly.y" { utilize(yyvsp[-6].ival, yyvsp[-5].ival, yyvsp[-3].opval, yyvsp[-2].opval, yyvsp[-1].opval); } break; case 65: -#line 321 "perly.y" +#line 319 "perly.y" { yyval.opval = newLOGOP(OP_AND, 0, yyvsp[-2].opval, yyvsp[0].opval); } break; case 66: -#line 323 "perly.y" +#line 321 "perly.y" { yyval.opval = newLOGOP(yyvsp[-1].ival, 0, yyvsp[-2].opval, yyvsp[0].opval); } break; case 68: -#line 328 "perly.y" +#line 326 "perly.y" { yyval.opval = yyvsp[-1].opval; } break; case 69: -#line 330 "perly.y" +#line 328 "perly.y" { yyval.opval = append_elem(OP_LIST, yyvsp[-2].opval, yyvsp[0].opval); } break; case 71: -#line 335 "perly.y" +#line 333 "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 72: -#line 338 "perly.y" +#line 336 "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 73: -#line 341 "perly.y" +#line 339 "perly.y" { yyval.opval = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, scalar(yyvsp[-5].opval), yyvsp[-1].opval), newUNOP(OP_METHOD, 0, yyvsp[-3].opval))); } break; case 74: -#line 346 "perly.y" +#line 344 "perly.y" { yyval.opval = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, yyvsp[-1].opval, yyvsp[0].opval), newUNOP(OP_METHOD, 0, yyvsp[-2].opval))); } break; case 75: -#line 351 "perly.y" +#line 349 "perly.y" { yyval.opval = convert(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, prepend_elem(OP_LIST, yyvsp[-3].opval, yyvsp[-1].opval), newUNOP(OP_METHOD, 0, yyvsp[-4].opval))); } break; case 76: -#line 356 "perly.y" +#line 354 "perly.y" { yyval.opval = convert(yyvsp[-1].ival, 0, yyvsp[0].opval); } break; case 77: -#line 358 "perly.y" +#line 356 "perly.y" { yyval.opval = convert(yyvsp[-3].ival, 0, yyvsp[-1].opval); } break; case 78: -#line 360 "perly.y" +#line 358 "perly.y" { yyvsp[0].opval = newANONSUB(yyvsp[-1].ival, 0, yyvsp[0].opval); } break; case 79: -#line 362 "perly.y" +#line 360 "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 82: -#line 372 "perly.y" +#line 370 "perly.y" { yyval.opval = newASSIGNOP(OPf_STACKED, yyvsp[-2].opval, yyvsp[-1].ival, yyvsp[0].opval); } break; case 83: -#line 374 "perly.y" +#line 372 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 84: -#line 376 "perly.y" +#line 374 "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 85: -#line 380 "perly.y" +#line 378 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 86: -#line 382 "perly.y" +#line 380 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 87: -#line 384 "perly.y" +#line 382 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 88: -#line 386 "perly.y" +#line 384 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 89: -#line 388 "perly.y" +#line 386 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 90: -#line 390 "perly.y" +#line 388 "perly.y" { yyval.opval = newBINOP(yyvsp[-1].ival, 0, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval)); } break; case 91: -#line 392 "perly.y" +#line 390 "perly.y" { yyval.opval = newRANGE(yyvsp[-1].ival, scalar(yyvsp[-2].opval), scalar(yyvsp[0].opval));} break; case 92: -#line 394 "perly.y" +#line 392 "perly.y" { yyval.opval = newLOGOP(OP_AND, 0, yyvsp[-2].opval, yyvsp[0].opval); } break; case 93: -#line 396 "perly.y" +#line 394 "perly.y" { yyval.opval = newLOGOP(OP_OR, 0, yyvsp[-2].opval, yyvsp[0].opval); } break; case 94: -#line 398 "perly.y" +#line 396 "perly.y" { yyval.opval = newCONDOP(0, yyvsp[-4].opval, yyvsp[-2].opval, yyvsp[0].opval); } break; case 95: -#line 400 "perly.y" +#line 398 "perly.y" { yyval.opval = bind_match(yyvsp[-1].ival, yyvsp[-2].opval, yyvsp[0].opval); } break; case 96: -#line 403 "perly.y" +#line 401 "perly.y" { yyval.opval = newUNOP(OP_NEGATE, 0, scalar(yyvsp[0].opval)); } break; case 97: -#line 405 "perly.y" +#line 403 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 98: -#line 407 "perly.y" +#line 405 "perly.y" { yyval.opval = newUNOP(OP_NOT, 0, scalar(yyvsp[0].opval)); } break; case 99: -#line 409 "perly.y" +#line 407 "perly.y" { yyval.opval = newUNOP(OP_COMPLEMENT, 0, scalar(yyvsp[0].opval));} break; case 100: -#line 411 "perly.y" +#line 409 "perly.y" { yyval.opval = newUNOP(OP_REFGEN, 0, mod(yyvsp[0].opval,OP_REFGEN)); } break; case 101: -#line 413 "perly.y" +#line 411 "perly.y" { yyval.opval = newUNOP(OP_POSTINC, 0, mod(scalar(yyvsp[-1].opval), OP_POSTINC)); } break; case 102: -#line 416 "perly.y" +#line 414 "perly.y" { yyval.opval = newUNOP(OP_POSTDEC, 0, mod(scalar(yyvsp[-1].opval), OP_POSTDEC)); } break; case 103: -#line 419 "perly.y" +#line 417 "perly.y" { yyval.opval = newUNOP(OP_PREINC, 0, mod(scalar(yyvsp[0].opval), OP_PREINC)); } break; case 104: -#line 422 "perly.y" +#line 420 "perly.y" { yyval.opval = newUNOP(OP_PREDEC, 0, mod(scalar(yyvsp[0].opval), OP_PREDEC)); } break; case 105: -#line 425 "perly.y" +#line 423 "perly.y" { yyval.opval = localize(yyvsp[0].opval,yyvsp[-1].ival); } break; case 106: -#line 427 "perly.y" +#line 425 "perly.y" { yyval.opval = sawparens(yyvsp[-1].opval); } break; case 107: -#line 429 "perly.y" +#line 427 "perly.y" { yyval.opval = sawparens(newNULLLIST()); } break; case 108: -#line 431 "perly.y" +#line 429 "perly.y" { yyval.opval = newANONLIST(yyvsp[-1].opval); } break; case 109: -#line 433 "perly.y" +#line 431 "perly.y" { yyval.opval = newANONLIST(Nullop); } break; case 110: -#line 435 "perly.y" +#line 433 "perly.y" { yyval.opval = newANONHASH(yyvsp[-2].opval); } break; case 111: -#line 437 "perly.y" +#line 435 "perly.y" { yyval.opval = newANONHASH(Nullop); } break; case 112: -#line 439 "perly.y" +#line 437 "perly.y" { yyval.opval = newANONSUB(yyvsp[-2].ival, yyvsp[-1].opval, yyvsp[0].opval); } break; case 113: -#line 441 "perly.y" +#line 439 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 114: -#line 443 "perly.y" +#line 441 "perly.y" { yyval.opval = newBINOP(OP_GELEM, 0, newGVREF(0,yyvsp[-4].opval), yyvsp[-2].opval); } break; case 115: -#line 445 "perly.y" +#line 443 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 116: -#line 447 "perly.y" +#line 445 "perly.y" { yyval.opval = newBINOP(OP_AELEM, 0, oopsAV(yyvsp[-3].opval), scalar(yyvsp[-1].opval)); } break; case 117: -#line 449 "perly.y" +#line 447 "perly.y" { yyval.opval = newBINOP(OP_AELEM, 0, ref(newAVREF(yyvsp[-4].opval),OP_RV2AV), scalar(yyvsp[-1].opval));} break; case 118: -#line 453 "perly.y" +#line 451 "perly.y" { assertref(yyvsp[-3].opval); yyval.opval = newBINOP(OP_AELEM, 0, ref(newAVREF(yyvsp[-3].opval),OP_RV2AV), scalar(yyvsp[-1].opval));} break; case 119: -#line 457 "perly.y" +#line 455 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 120: -#line 459 "perly.y" +#line 457 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 121: -#line 461 "perly.y" +#line 459 "perly.y" { yyval.opval = newUNOP(OP_AV2ARYLEN, 0, ref(yyvsp[0].opval, OP_AV2ARYLEN));} break; case 122: -#line 463 "perly.y" +#line 461 "perly.y" { yyval.opval = newBINOP(OP_HELEM, 0, oopsHV(yyvsp[-4].opval), jmaybe(yyvsp[-2].opval)); expect = XOPERATOR; } break; case 123: -#line 466 "perly.y" +#line 464 "perly.y" { yyval.opval = newBINOP(OP_HELEM, 0, ref(newHVREF(yyvsp[-5].opval),OP_RV2HV), jmaybe(yyvsp[-2].opval)); expect = XOPERATOR; } break; case 124: -#line 471 "perly.y" +#line 469 "perly.y" { assertref(yyvsp[-4].opval); yyval.opval = newBINOP(OP_HELEM, 0, ref(newHVREF(yyvsp[-4].opval),OP_RV2HV), jmaybe(yyvsp[-2].opval)); expect = XOPERATOR; } break; case 125: -#line 476 "perly.y" +#line 474 "perly.y" { yyval.opval = newSLICEOP(0, yyvsp[-1].opval, yyvsp[-4].opval); } break; case 126: -#line 478 "perly.y" +#line 476 "perly.y" { yyval.opval = newSLICEOP(0, yyvsp[-1].opval, Nullop); } break; case 127: -#line 480 "perly.y" +#line 478 "perly.y" { yyval.opval = prepend_elem(OP_ASLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_ASLICE, 0, @@ -2024,7 +2022,7 @@ case 127: ref(yyvsp[-3].opval, OP_ASLICE))); } break; case 128: -#line 486 "perly.y" +#line 484 "perly.y" { yyval.opval = prepend_elem(OP_HSLICE, newOP(OP_PUSHMARK, 0), newLISTOP(OP_HSLICE, 0, @@ -2033,37 +2031,37 @@ case 128: expect = XOPERATOR; } break; case 129: -#line 493 "perly.y" +#line 491 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 130: -#line 495 "perly.y" +#line 493 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, 0, scalar(yyvsp[0].opval)); } break; case 131: -#line 497 "perly.y" +#line 495 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar(yyvsp[-2].opval)); } break; case 132: -#line 499 "perly.y" +#line 497 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, yyvsp[-1].opval, scalar(yyvsp[-3].opval))); } break; case 133: -#line 502 "perly.y" +#line 500 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, yyvsp[0].opval, scalar(yyvsp[-1].opval))); } break; case 134: -#line 505 "perly.y" +#line 503 "perly.y" { yyval.opval = newUNOP(OP_DOFILE, 0, scalar(yyvsp[0].opval)); } break; case 135: -#line 507 "perly.y" +#line 505 "perly.y" { yyval.opval = newUNOP(OP_NULL, OPf_SPECIAL, scope(yyvsp[0].opval)); } break; case 136: -#line 509 "perly.y" +#line 507 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, @@ -2073,7 +2071,7 @@ case 136: )),Nullop)); dep();} break; case 137: -#line 517 "perly.y" +#line 515 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, append_elem(OP_LIST, @@ -2084,150 +2082,150 @@ case 137: )))); dep();} break; case 138: -#line 526 "perly.y" +#line 524 "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 139: -#line 530 "perly.y" +#line 528 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_SPECIAL|OPf_STACKED, prepend_elem(OP_LIST, yyvsp[-1].opval, scalar(newCVREF(0,scalar(yyvsp[-3].opval))))); dep();} break; case 140: -#line 535 "perly.y" +#line 533 "perly.y" { yyval.opval = newOP(yyvsp[0].ival, OPf_SPECIAL); hints |= HINT_BLOCK_SCOPE; } break; case 141: -#line 538 "perly.y" +#line 536 "perly.y" { yyval.opval = newLOOPEX(yyvsp[-1].ival,yyvsp[0].opval); } break; case 142: -#line 540 "perly.y" +#line 538 "perly.y" { yyval.opval = newUNOP(OP_NOT, 0, scalar(yyvsp[0].opval)); } break; case 143: -#line 542 "perly.y" +#line 540 "perly.y" { yyval.opval = newOP(yyvsp[0].ival, 0); } break; case 144: -#line 544 "perly.y" +#line 542 "perly.y" { yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } break; case 145: -#line 546 "perly.y" +#line 544 "perly.y" { yyval.opval = newUNOP(yyvsp[-1].ival, 0, yyvsp[0].opval); } break; case 146: -#line 548 "perly.y" +#line 546 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_STACKED, append_elem(OP_LIST, yyvsp[0].opval, scalar(yyvsp[-1].opval))); } break; case 147: -#line 551 "perly.y" +#line 549 "perly.y" { yyval.opval = newOP(yyvsp[0].ival, 0); } break; case 148: -#line 553 "perly.y" +#line 551 "perly.y" { yyval.opval = newOP(yyvsp[-2].ival, 0); } break; case 149: -#line 555 "perly.y" +#line 553 "perly.y" { yyval.opval = newUNOP(OP_ENTERSUB, OPf_STACKED, scalar(yyvsp[0].opval)); } break; case 150: -#line 558 "perly.y" +#line 556 "perly.y" { yyval.opval = newOP(yyvsp[-2].ival, OPf_SPECIAL); } break; case 151: -#line 560 "perly.y" +#line 558 "perly.y" { yyval.opval = newUNOP(yyvsp[-3].ival, 0, yyvsp[-1].opval); } break; case 152: -#line 562 "perly.y" +#line 560 "perly.y" { yyval.opval = pmruntime(yyvsp[-3].opval, yyvsp[-1].opval, Nullop); } break; case 153: -#line 564 "perly.y" +#line 562 "perly.y" { yyval.opval = pmruntime(yyvsp[-5].opval, yyvsp[-3].opval, yyvsp[-1].opval); } break; case 156: -#line 570 "perly.y" +#line 568 "perly.y" { yyval.opval = Nullop; } break; case 157: -#line 572 "perly.y" +#line 570 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 158: -#line 576 "perly.y" +#line 574 "perly.y" { yyval.opval = Nullop; } break; case 159: -#line 578 "perly.y" +#line 576 "perly.y" { yyval.opval = yyvsp[0].opval; } break; case 160: -#line 580 "perly.y" +#line 578 "perly.y" { yyval.opval = yyvsp[-1].opval; } break; case 161: -#line 583 "perly.y" +#line 581 "perly.y" { yyval.ival = 0; } break; case 162: -#line 584 "perly.y" +#line 582 "perly.y" { yyval.ival = 1; } break; case 163: -#line 588 "perly.y" +#line 586 "perly.y" { in_my = 0; yyval.opval = my(yyvsp[0].opval); } break; case 164: -#line 592 "perly.y" +#line 590 "perly.y" { yyval.opval = newCVREF(yyvsp[-1].ival,yyvsp[0].opval); } break; case 165: -#line 596 "perly.y" +#line 594 "perly.y" { yyval.opval = newSVREF(yyvsp[0].opval); } break; case 166: -#line 600 "perly.y" +#line 598 "perly.y" { yyval.opval = newAVREF(yyvsp[0].opval); } break; case 167: -#line 604 "perly.y" +#line 602 "perly.y" { yyval.opval = newHVREF(yyvsp[0].opval); } break; case 168: -#line 608 "perly.y" +#line 606 "perly.y" { yyval.opval = newAVREF(yyvsp[0].opval); } break; case 169: -#line 612 "perly.y" +#line 610 "perly.y" { yyval.opval = newGVREF(0,yyvsp[0].opval); } break; case 170: -#line 616 "perly.y" +#line 614 "perly.y" { yyval.opval = scalar(yyvsp[0].opval); } break; case 171: -#line 618 "perly.y" +#line 616 "perly.y" { yyval.opval = scalar(yyvsp[0].opval); } break; case 172: -#line 620 "perly.y" +#line 618 "perly.y" { yyval.opval = scope(yyvsp[0].opval); } break; case 173: -#line 623 "perly.y" +#line 621 "perly.y" { yyval.opval = yyvsp[0].opval; } break; -#line 2217 "perly.c" +#line 2215 "perly.c" } yyssp -= yym; yystate = *yyssp; diff --git a/perly.c.diff b/perly.c.diff index 4bae11a..beedeb7 100644 --- a/perly.c.diff +++ b/perly.c.diff @@ -88,7 +88,7 @@ Index: perly.c - short yyss[YYSTACKSIZE]; - YYSTYPE yyvs[YYSTACKSIZE]; - #define yystacksize YYSTACKSIZE - #line 626 "perly.y" + #line 624 "perly.y" /* PROGRAM */ --- 1238,1243 ---- *************** @@ -300,14 +300,14 @@ Index: perly.c yystate, yyn, yyrule[yyn]); #endif *************** -*** 2224,2229 **** +*** 2222,2227 **** #if YYDEBUG if (yydebug) ! printf("yydebug: after reduction, shifting from state 0 to\ ! state %d\n", YYFINAL); #endif yystate = YYFINAL; ---- 2238,2244 ---- +--- 2236,2242 ---- #if YYDEBUG if (yydebug) ! fprintf(stderr, @@ -316,20 +316,20 @@ Index: perly.c #endif yystate = YYFINAL; *************** -*** 2239,2243 **** +*** 2237,2241 **** if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; ! printf("yydebug: state %d, reading %d (%s)\n", YYFINAL, yychar, yys); } ---- 2254,2258 ---- +--- 2252,2256 ---- if (yychar <= YYMAXTOKEN) yys = yyname[yychar]; if (!yys) yys = "illegal-symbol"; ! fprintf(stderr, "yydebug: state %d, reading %d (%s)\n", YYFINAL, yychar, yys); } *************** -*** 2254,2263 **** +*** 2252,2261 **** #if YYDEBUG if (yydebug) ! printf("yydebug: after reduction, shifting from state %d \ @@ -340,7 +340,7 @@ Index: perly.c ! goto yyoverflow; } *++yyssp = yystate; ---- 2269,2293 ---- +--- 2267,2291 ---- #if YYDEBUG if (yydebug) ! fprintf(stderr, @@ -367,7 +367,7 @@ Index: perly.c } *++yyssp = yystate; *************** -*** 2265,2272 **** +*** 2263,2270 **** goto yyloop; yyoverflow: ! yyerror("yacc stack overflow"); @@ -376,7 +376,7 @@ Index: perly.c yyaccept: ! return (0); } ---- 2295,2302 ---- +--- 2293,2300 ---- goto yyloop; yyoverflow: ! yyerror("Out of memory for yacc stack"); diff --git a/perly.y b/perly.y index 7da1be3..608f9e0 100644 --- a/perly.y +++ b/perly.y @@ -276,18 +276,16 @@ subrout : SUB startsub subname proto subbody { newSUB($2, $3, $4, $5); } ; -startsub: /* NULL */ /* start a subroutine scope */ - { $$ = start_subparse(); } +startsub: /* NULL */ /* start a regular subroutine scope */ + { $$ = start_subparse(0); } ; startanonsub: /* NULL */ /* start an anonymous subroutine scope */ - { $$ = start_subparse(); - CvANON_on(compcv); } + { $$ = start_subparse(CVf_ANON); } ; startformsub: /* NULL */ /* start a format subroutine scope */ - { $$ = start_subparse(); - CvFORMAT_on(compcv); } + { $$ = start_subparse(CVf_FORMAT); } ; subname : WORD { char *name = SvPVx(((SVOP*)$1)->op_sv, na); diff --git a/proto.h b/proto.h index 86aaf73..1f4ce32 100644 --- a/proto.h +++ b/proto.h @@ -420,7 +420,7 @@ char* sharepvn _((char* sv, I32 len, U32 hash)); HEK* share_hek _((char* sv, I32 len, U32 hash)); Signal_t sighandler _((int sig)); SV** stack_grow _((SV** sp, SV**p, int n)); -int start_subparse _((void)); +int start_subparse _((U32 flags)); void sub_crush_depth _((CV* cv)); bool sv_2bool _((SV* sv)); CV* sv_2cv _((SV* sv, HV** st, GV** gvp, I32 lref)); diff --git a/sv.c b/sv.c index 32ca7da..4139233 100644 --- a/sv.c +++ b/sv.c @@ -3593,7 +3593,7 @@ I32 lref; ENTER; tmpsv = NEWSV(704,0); gv_efullname3(tmpsv, gv, Nullch); - newSUB(start_subparse(), + newSUB(start_subparse(0), newSVOP(OP_CONST, 0, tmpsv), Nullop, Nullop); @@ -4179,10 +4179,11 @@ SV* sv; if (HvNAME(sv)) PerlIO_printf(Perl_debug_log, " NAME = \"%s\"\n", HvNAME(sv)); break; - case SVt_PVFM: case SVt_PVCV: if (SvPOK(sv)) PerlIO_printf(Perl_debug_log, " PROTOTYPE = \"%s\"\n", SvPV(sv,na)); + /* FALL THROUGH */ + case SVt_PVFM: PerlIO_printf(Perl_debug_log, " STASH = 0x%lx\n", (long)CvSTASH(sv)); PerlIO_printf(Perl_debug_log, " START = 0x%lx\n", (long)CvSTART(sv)); PerlIO_printf(Perl_debug_log, " ROOT = 0x%lx\n", (long)CvROOT(sv)); diff --git a/toke.c b/toke.c index ad978a8..24805a7 100644 --- a/toke.c +++ b/toke.c @@ -2010,7 +2010,9 @@ yylex() bufptr = s; return yylex(); /* ignore fake brackets */ } - if (*s != '[' && *s != '{' && (*s != '-' || s[1] != '>')) + if (*s == '-' && s[1] == '>') + lex_state = LEX_INTERPENDMAYBE; + else if (*s != '[' && *s != '{') lex_state = LEX_INTERPEND; } } @@ -4350,8 +4352,13 @@ I32 ck_uni; } if (bracket) { if (isSPACE(s[-1])) { - while (s < send && (*s == ' ' || *s == '\t')) s++; - *d = *s; + while (s < send) { + char ch = *s++; + if (ch != ' ' && ch != '\t') { + *d = ch; + break; + } + } } if (isIDFIRST(*d)) { d++; @@ -5062,7 +5069,8 @@ set_csh() } int -start_subparse() +start_subparse(flags) +U32 flags; { int oldsavestack_ix = savestack_ix; CV* outsidecv = compcv; @@ -5084,7 +5092,8 @@ start_subparse() SAVEI32(pad_reset_pending); compcv = (CV*)NEWSV(1104,0); - sv_upgrade((SV *)compcv, SVt_PVCV); + sv_upgrade((SV *)compcv, (flags & CVf_FORMAT) ? SVt_PVFM : SVt_PVCV); + CvFLAGS(compcv) |= flags; comppad = newAV(); comppad_name = newAV();