diff options
author | Perl 5 Porters <perl5-porters@africa.nicoh.com> | 1997-01-17 08:39:00 +1200 |
---|---|---|
committer | Chip Salzenberg <chip@atlantic.net> | 1997-01-17 08:39:00 +1200 |
commit | fa83b5b6263413f922909c255e021c32c808b32d (patch) | |
tree | 4f21edebbdd75d0613487aca81c35c1190e483d9 /perly.c | |
parent | 743c51bca697772277895eb80832bcfbd65530df (diff) | |
download | perl-fa83b5b6263413f922909c255e021c32c808b32d.tar.gz |
[inseparable changes from patch from perl5.003_21 to perl5.003_22]perl-5.003_22
CORE LANGUAGE CHANGES
Subject: Fix parsing of C< ${ xyz } >
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
Subject: Don't parse method calls in strings
From: Chip Salzenberg <chip@atlantic.net>
Files: toke.c
OTHER CORE CHANGES
Subject: Fix memory corruption from formats
From: Chip Salzenberg <chip@atlantic.net>
Files: op.c perl.c perly.c perly.c.diff perly.y proto.h sv.c toke.c
Diffstat (limited to 'perly.c')
-rw-r--r-- | perly.c | 236 |
1 files changed, 117 insertions, 119 deletions
@@ -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; |