This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
installperl couldn't tell whether it had run tests or not.
[perl5.git] / perly_c.diff
CommitLineData
09bef843
SB
1*** y.tab.c.orig Thu Aug 26 22:31:26 1999
2--- y.tab.c Thu Aug 26 22:32:22 1999
93a17b20 3***************
09bef843
SB
4*** 1447,1456 ****
5 yyparse()
0da4822f
GS
6 {
7 register int yym, yyn, yystate;
8 #if YYDEBUG
9 register char *yys;
09bef843 10! extern char *getenv();
0da4822f
GS
11
12 if (yys = getenv("YYDEBUG"))
13 {
09bef843 14 yyn = *yys;
f4dd75d9 15--- 1447,1476 ----
09bef843 16 yyparse()
93a17b20
LW
17 {
18 register int yym, yyn, yystate;
19+ register short *yyssp;
20+ register YYSTYPE *yyvsp;
21+ short* yyss;
22+ YYSTYPE* yyvs;
23+ unsigned yystacksize = YYSTACKSIZE;
93a17b20 24+ int retval = 0;
93a17b20
LW
25 #if YYDEBUG
26 register char *yys;
09bef843
SB
27! #endif
28
8c52afec 29+ struct ysv *ysave;
f4dd75d9
GS
30+ #ifdef USE_ITHREADS
31+ ENTER; /* force yydestruct() before we return */
32+ #endif
8c52afec 33+ New(73, ysave, 1, struct ysv);
e1f15930 34+ SAVEDESTRUCTOR_X(yydestruct, ysave);
a0d0e21e
LW
35+ ysave->oldyydebug = yydebug;
36+ ysave->oldyynerrs = yynerrs;
37+ ysave->oldyyerrflag = yyerrflag;
38+ ysave->oldyychar = yychar;
39+ ysave->oldyyval = yyval;
40+ ysave->oldyylval = yylval;
09bef843 41+
a0d0e21e
LW
42+ #if YYDEBUG
43 if (yys = getenv("YYDEBUG"))
44 {
09bef843 45 yyn = *yys;
93a17b20 46***************
09bef843 47*** 1463,1468 ****
f4dd75d9 48--- 1483,1498 ----
09bef843 49 yyerrflag = 0;
93a17b20
LW
50 yychar = (-1);
51
52+ /*
53+ ** Initialize private stacks (yyparse may be called from an action)
54+ */
8c52afec
IZ
55+ New(73, yyss, yystacksize, short);
56+ New(73, yyvs, yystacksize, YYSTYPE);
57+ ysave->yyss = yyss;
58+ ysave->yyvs = yyvs;
93a17b20
LW
59+ if (!yyvs || !yyss)
60+ goto yyoverflow;
61+
62 yyssp = yyss;
63 yyvsp = yyvs;
09bef843 64 *yyssp = yystate = 0;
93a17b20 65***************
09bef843 66*** 1493,1499 ****
93a17b20 67 #endif
9d116dd7
JH
68 if (yyssp >= yyss + yystacksize - 1)
69 {
70! goto yyoverflow;
71 }
72 *++yyssp = yystate = yytable[yyn];
09bef843 73 *++yyvsp = yylval;
f4dd75d9 74--- 1523,1541 ----
d3b6f988 75 #endif
93a17b20
LW
76 if (yyssp >= yyss + yystacksize - 1)
77 {
78! /*
79! ** reallocate and recover. Note that pointers
80! ** have to be reset, or bad things will happen
81! */
82! int yyps_index = (yyssp - yyss);
83! int yypv_index = (yyvsp - yyvs);
84! yystacksize += YYSTACKSIZE;
09bef843
SB
85! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
86! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
87! if (!yyvs || !yyss)
88! goto yyoverflow;
89! yyssp = yyss + yyps_index;
90! yyvsp = yyvs + yypv_index;
91 }
92 *++yyssp = yystate = yytable[yyn];
09bef843 93 *++yyvsp = yylval;
93a17b20 94***************
09bef843 95*** 1534,1540 ****
93a17b20
LW
96 #endif
97 if (yyssp >= yyss + yystacksize - 1)
98 {
99! goto yyoverflow;
100 }
101 *++yyssp = yystate = yytable[yyn];
09bef843 102 *++yyvsp = yylval;
f4dd75d9 103--- 1576,1594 ----
93a17b20
LW
104 #endif
105 if (yyssp >= yyss + yystacksize - 1)
106 {
107! /*
108! ** reallocate and recover. Note that pointers
109! ** have to be reset, or bad things will happen
110! */
111! int yyps_index = (yyssp - yyss);
112! int yypv_index = (yyvsp - yyvs);
113! yystacksize += YYSTACKSIZE;
09bef843
SB
114! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
115! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
116! if (!yyvs || !yyss)
117! goto yyoverflow;
118! yyssp = yyss + yyps_index;
119! yyvsp = yyvs + yypv_index;
120 }
121 *++yyssp = yystate = yytable[yyn];
09bef843 122 *++yyvsp = yylval;
93a17b20 123***************
09bef843 124*** 2473,2487 ****
93a17b20
LW
125 #endif
126 if (yyssp >= yyss + yystacksize - 1)
127 {
128! goto yyoverflow;
129 }
130 *++yyssp = yystate;
09bef843
SB
131 *++yyvsp = yyval;
132 goto yyloop;
133 yyoverflow:
134! yyerror("yacc stack overflow");
135 yyabort:
136! return (1);
137 yyaccept:
138! return (0);
139 }
f4dd75d9 140--- 2527,2575 ----
93a17b20
LW
141 #endif
142 if (yyssp >= yyss + yystacksize - 1)
143 {
144! /*
145! ** reallocate and recover. Note that pointers
146! ** have to be reset, or bad things will happen
147! */
148! int yyps_index = (yyssp - yyss);
149! int yypv_index = (yyvsp - yyvs);
150! yystacksize += YYSTACKSIZE;
09bef843
SB
151! ysave->yyvs = Renew(yyvs, yystacksize, YYSTYPE);
152! ysave->yyss = Renew(yyss, yystacksize, short);
93a17b20
LW
153! if (!yyvs || !yyss)
154! goto yyoverflow;
155! yyssp = yyss + yyps_index;
156! yyvsp = yyvs + yypv_index;
157 }
158 *++yyssp = yystate;
09bef843 159 *++yyvsp = yyval;
93a17b20
LW
160 goto yyloop;
161 yyoverflow:
162! yyerror("Out of memory for yacc stack");
163 yyabort:
164! retval = 1;
165 yyaccept:
f4dd75d9
GS
166! #ifdef USE_ITHREADS
167! LEAVE; /* force yydestruct() before we return */
168! #endif
93a17b20 169! return retval;
e1f15930
GS
170! }
171!
172! #ifdef PERL_OBJECT
e1f15930
GS
173! #include "XSUB.h"
174! #endif
175!
176! static void
177! yydestruct(pTHXo_ void *ptr)
178! {
179! struct ysv* ysave = (struct ysv*)ptr;
180! if (ysave->yyss) Safefree(ysave->yyss);
181! if (ysave->yyvs) Safefree(ysave->yyvs);
182! yydebug = ysave->oldyydebug;
183! yynerrs = ysave->oldyynerrs;
184! yyerrflag = ysave->oldyyerrflag;
185! yychar = ysave->oldyychar;
186! yyval = ysave->oldyyval;
187! yylval = ysave->oldyylval;
188! Safefree(ysave);
93a17b20 189 }