/[pkgs]/devel/perl/32891.patch
ViewVC logotype

Contents of /devel/perl/32891.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Fri Mar 7 22:11:53 2008 UTC (20 months, 2 weeks ago) by spot
Branch: MAIN
CVS Tags: perl-5_10_0-19_fc9, F-12-split, perl-5_10_0-63_fc11, perl-5_10_0-61_fc11, perl-5_10_0-80_fc12, perl-5_10_0-81_fc12, perl-5_10_0-84_fc13, perl-5_10_0-82_fc13, perl-5_10_0-51_fc11, perl-5_10_0-77_fc12, perl-5_10_0-17_fc9, perl-5_10_0-83_fc13, perl-5_10_0-45_fc10, perl-5_10_0-71_fc12, perl-5_10_0-57_fc11, perl-5_10_0-26_fc10, perl-5_10_0-41_fc10, perl-5_10_0-75_fc12, perl-5_10_0-53_fc11, perl-5_10_0-73_fc12, perl-5_10_0-68_fc11, perl-5_10_0-67_fc11, perl-5_10_0-13_fc9, perl-5_10_0-12_fc9, perl-5_10_0-64_fc11, perl-5_10_0-28_fc10, perl-5_10_0-18_fc9, perl-5_10_0-72_fc12, F-10-split, perl-5_10_0-54_fc11, perl-5_10_0-14_fc9, perl-5_10_0-46_fc10, F-11-split, perl-5_10_0-9_fc9, perl-5_10_0-49_fc10, perl-5_10_0-10_fc9, perl-5_10_0-8_fc9, perl-5_10_0-21_fc10, perl-5_10_0-15_fc9, perl-5_10_0-43_fc10, perl-5_10_0-20_fc9, perl-5_10_0-38_fc10, perl-5_10_0-62_fc11, perl-5_10_0-24_fc10, perl-5_10_0-48_fc10, perl-5_10_0-69_fc12, perl-5_10_0-25_fc10, perl-5_10_0-79_fc12, perl-5_10_0-78_fc12, perl-5_10_0-32_fc10, perl-5_10_0-11_fc9, perl-5_10_0-56_fc11, perl-5_10_0-70_fc12, perl-5_10_0-44_fc10, perl-5_10_0-52_fc11, perl-5_10_0-74_fc12, perl-5_10_0-40_fc10, perl-5_10_0-33_fc10, perl-5_10_0-66_fc11, F-9-split, perl-5_10_0-34_fc10, perl-5_10_0-47_fc10, perl-5_10_0-35_fc10, perl-5_10_0-37_fc10, perl-5_10_0-59_fc11, perl-5_10_0-65_fc11, perl-5_10_0-39_fc10, perl-5_10_0-58_fc11, perl-5_10_0-60_fc11, perl-5_10_0-36_fc10, perl-5_10_0-76_fc12, HEAD
File MIME type: text/x-patch
change 32891, sitedir/sitearch in /usr/local
1 --- perl-5.10.0/op.c 2007-12-18 05:47:07.000000000 -0500
2 +++ perl-5.10.0/op.c 2007-12-31 11:15:57.000000000 -0500
3 @@ -3992,6 +3992,7 @@
4 static const char no_list_state[] = "Initialization of state variables"
5 " in list context currently forbidden";
6 OP *curop;
7 + bool maybe_common_vars = TRUE;
8
9 PL_modcount = 0;
10 /* Grandfathering $[ assignment here. Bletch.*/
11 @@ -4009,6 +4010,65 @@
12 o = newBINOP(OP_AASSIGN, flags, list(force_list(right)), curop);
13 o->op_private = (U8)(0 | (flags >> 8));
14
15 + if ((left->op_type == OP_LIST
16 + || (left->op_type == OP_NULL && left->op_targ == OP_LIST)))
17 + {
18 + OP* lop = ((LISTOP*)left)->op_first;
19 + maybe_common_vars = FALSE;
20 + while (lop) {
21 + if (lop->op_type == OP_PADSV ||
22 + lop->op_type == OP_PADAV ||
23 + lop->op_type == OP_PADHV ||
24 + lop->op_type == OP_PADANY) {
25 + if (!(lop->op_private & OPpLVAL_INTRO))
26 + maybe_common_vars = TRUE;
27 +
28 + if (lop->op_private & OPpPAD_STATE) {
29 + if (left->op_private & OPpLVAL_INTRO) {
30 + /* Each variable in state($a, $b, $c) = ... */
31 + }
32 + else {
33 + /* Each state variable in
34 + (state $a, my $b, our $c, $d, undef) = ... */
35 + }
36 + yyerror(no_list_state);
37 + } else {
38 + /* Each my variable in
39 + (state $a, my $b, our $c, $d, undef) = ... */
40 + }
41 + } else if (lop->op_type == OP_UNDEF ||
42 + lop->op_type == OP_PUSHMARK) {
43 + /* undef may be interesting in
44 + (state $a, undef, state $c) */
45 + } else {
46 + /* Other ops in the list. */
47 + maybe_common_vars = TRUE;
48 + }
49 + lop = lop->op_sibling;
50 + }
51 + }
52 + else if ((left->op_private & OPpLVAL_INTRO)
53 + && ( left->op_type == OP_PADSV
54 + || left->op_type == OP_PADAV
55 + || left->op_type == OP_PADHV
56 + || left->op_type == OP_PADANY))
57 + {
58 + maybe_common_vars = FALSE;
59 + if (left->op_private & OPpPAD_STATE) {
60 + /* All single variable list context state assignments, hence
61 + state ($a) = ...
62 + (state $a) = ...
63 + state @a = ...
64 + state (@a) = ...
65 + (state @a) = ...
66 + state %a = ...
67 + state (%a) = ...
68 + (state %a) = ...
69 + */
70 + yyerror(no_list_state);
71 + }
72 + }
73 +
74 /* PL_generation sorcery:
75 * an assignment like ($a,$b) = ($c,$d) is easier than
76 * ($a,$b) = ($c,$a), since there is no need for temporary vars.
77 @@ -4023,7 +4083,7 @@
78 * to store these values, evil chicanery is done with SvUVX().
79 */
80
81 - {
82 + if (maybe_common_vars) {
83 OP *lastop = o;
84 PL_generation++;
85 for (curop = LINKLIST(o); curop != o; curop = LINKLIST(curop)) {
86 @@ -4084,54 +4144,6 @@
87 o->op_private |= OPpASSIGN_COMMON;
88 }
89
90 - if ((left->op_type == OP_LIST
91 - || (left->op_type == OP_NULL && left->op_targ == OP_LIST))) {
92 - OP* lop = ((LISTOP*)left)->op_first;
93 - while (lop) {
94 - if (lop->op_type == OP_PADSV ||
95 - lop->op_type == OP_PADAV ||
96 - lop->op_type == OP_PADHV ||
97 - lop->op_type == OP_PADANY) {
98 - if (lop->op_private & OPpPAD_STATE) {
99 - if (left->op_private & OPpLVAL_INTRO) {
100 - /* Each variable in state($a, $b, $c) = ... */
101 - }
102 - else {
103 - /* Each state variable in
104 - (state $a, my $b, our $c, $d, undef) = ... */
105 - }
106 - yyerror(no_list_state);
107 - } else {
108 - /* Each my variable in
109 - (state $a, my $b, our $c, $d, undef) = ... */
110 - }
111 - } else {
112 - /* Other ops in the list. undef may be interesting in
113 - (state $a, undef, state $c) */
114 - }
115 - lop = lop->op_sibling;
116 - }
117 - }
118 - else if (((left->op_private & (OPpLVAL_INTRO | OPpPAD_STATE))
119 - == (OPpLVAL_INTRO | OPpPAD_STATE))
120 - && ( left->op_type == OP_PADSV
121 - || left->op_type == OP_PADAV
122 - || left->op_type == OP_PADHV
123 - || left->op_type == OP_PADANY))
124 - {
125 - /* All single variable list context state assignments, hence
126 - state ($a) = ...
127 - (state $a) = ...
128 - state @a = ...
129 - state (@a) = ...
130 - (state @a) = ...
131 - state %a = ...
132 - state (%a) = ...
133 - (state %a) = ...
134 - */
135 - yyerror(no_list_state);
136 - }
137 -
138 if (right && right->op_type == OP_SPLIT && !PL_madskills) {
139 OP* tmpop = ((LISTOP*)right)->op_first;
140 if (tmpop && (tmpop->op_type == OP_PUSHRE)) {

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2