MFB: add sanity check for ZEND_MMAP_AHEAD

This commit is contained in:
Nuno Lopes 2008-04-04 15:13:32 +00:00
parent e15c6ca077
commit 099d515279
7 changed files with 547 additions and 523 deletions

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.4.dev on Wed Mar 26 15:14:24 2008 */
/* Generated by re2c 0.13.4.dev on Fri Apr 4 16:10:13 2008 */
#line 1 "Zend/zend_ini_scanner.l"
/*
+----------------------------------------------------------------------+
@ -24,6 +24,11 @@
/* $Id$ */
#include <errno.h>
#include "zend.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
#if 0
# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
@ -52,6 +57,14 @@
#define yyless(x) YYCURSOR = yytext + x
/* #define yymore() goto yymore_restart */
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
#define YYMAXFILL 6
#if ZEND_MMAP_AHEAD < YYMAXFILL
# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
#endif
/* How it works (for the core ini directives):
* ===========================================
*
@ -82,12 +95,6 @@
*
*/
#include <errno.h>
#include "zend.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
/* Globals Macros */
#define SCNG INI_SCNG
#ifdef ZTS
@ -296,7 +303,7 @@ restart:
}
#line 300 "Zend/zend_ini_scanner.c"
#line 307 "Zend/zend_ini_scanner.c"
{
YYCTYPE yych;
unsigned int yyaccept = 0;
@ -473,11 +480,11 @@ yy2:
++YYCURSOR;
YYDEBUG(3, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 481 "Zend/zend_ini_scanner.c"
#line 488 "Zend/zend_ini_scanner.c"
yy4:
YYDEBUG(4, *YYCURSOR);
yyaccept = 0;
@ -486,24 +493,24 @@ yy4:
yy5:
YYDEBUG(5, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 467 "Zend/zend_ini_scanner.l"
#line 474 "Zend/zend_ini_scanner.l"
{
/* eat whitespace */
goto restart;
}
#line 495 "Zend/zend_ini_scanner.c"
#line 502 "Zend/zend_ini_scanner.c"
yy6:
YYDEBUG(6, *YYCURSOR);
++YYCURSOR;
yy7:
YYDEBUG(7, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 472 "Zend/zend_ini_scanner.l"
#line 479 "Zend/zend_ini_scanner.l"
{
SCNG(lineno)++;
return END_OF_LINE;
}
#line 507 "Zend/zend_ini_scanner.c"
#line 514 "Zend/zend_ini_scanner.c"
yy8:
YYDEBUG(8, *YYCURSOR);
yych = *++YYCURSOR;
@ -514,11 +521,11 @@ yy9:
++YYCURSOR;
YYDEBUG(10, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 426 "Zend/zend_ini_scanner.l"
#line 433 "Zend/zend_ini_scanner.l"
{ /* Disallow these chars outside option values */
return yytext[0];
}
#line 522 "Zend/zend_ini_scanner.c"
#line 529 "Zend/zend_ini_scanner.c"
yy11:
YYDEBUG(11, *YYCURSOR);
++YYCURSOR;
@ -527,11 +534,11 @@ yy11:
yy12:
YYDEBUG(12, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 385 "Zend/zend_ini_scanner.l"
#line 392 "Zend/zend_ini_scanner.l"
{ /* Get option name */
RETURN_TOKEN(TC_LABEL, yytext, yyleng);
}
#line 535 "Zend/zend_ini_scanner.c"
#line 542 "Zend/zend_ini_scanner.c"
yy13:
YYDEBUG(13, *YYCURSOR);
yyaccept = 1;
@ -545,7 +552,7 @@ yy14:
yy15:
YYDEBUG(15, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 389 "Zend/zend_ini_scanner.l"
#line 396 "Zend/zend_ini_scanner.l"
{ /* Start option value */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
yy_push_state(ST_RAW TSRMLS_CC);
@ -554,7 +561,7 @@ yy15:
}
return '=';
}
#line 558 "Zend/zend_ini_scanner.c"
#line 565 "Zend/zend_ini_scanner.c"
yy16:
YYDEBUG(16, *YYCURSOR);
yych = *++YYCURSOR;
@ -610,7 +617,7 @@ yy21:
++YYCURSOR;
YYDEBUG(22, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 323 "Zend/zend_ini_scanner.l"
#line 330 "Zend/zend_ini_scanner.l"
{ /* Section start */
/* Enter section data lookup state */
if (SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW) {
@ -620,7 +627,7 @@ yy21:
}
return TC_SECTION;
}
#line 624 "Zend/zend_ini_scanner.c"
#line 631 "Zend/zend_ini_scanner.c"
yy23:
YYDEBUG(23, *YYCURSOR);
++YYCURSOR;
@ -650,7 +657,7 @@ yy26:
}
YYDEBUG(28, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 348 "Zend/zend_ini_scanner.l"
#line 355 "Zend/zend_ini_scanner.l"
{ /* Start of option with offset */
/* Eat trailing whitespace and [ */
EAT_TRAILING_WHITESPACE_EX('[');
@ -660,7 +667,7 @@ yy26:
RETURN_TOKEN(TC_OFFSET, yytext, yyleng);
}
#line 664 "Zend/zend_ini_scanner.c"
#line 671 "Zend/zend_ini_scanner.c"
yy29:
YYDEBUG(29, *YYCURSOR);
++YYCURSOR;
@ -672,11 +679,11 @@ yy29:
yy30:
YYDEBUG(30, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 377 "Zend/zend_ini_scanner.l"
#line 384 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 680 "Zend/zend_ini_scanner.c"
#line 687 "Zend/zend_ini_scanner.c"
yy31:
YYDEBUG(31, *YYCURSOR);
++YYCURSOR;
@ -714,11 +721,11 @@ yy36:
yy37:
YYDEBUG(37, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 381 "Zend/zend_ini_scanner.l"
#line 388 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 722 "Zend/zend_ini_scanner.c"
#line 729 "Zend/zend_ini_scanner.c"
yy38:
YYDEBUG(38, *YYCURSOR);
++YYCURSOR;
@ -813,13 +820,13 @@ yy51:
yy52:
YYDEBUG(52, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 823 "Zend/zend_ini_scanner.c"
#line 830 "Zend/zend_ini_scanner.c"
yy53:
YYDEBUG(53, *YYCURSOR);
yych = *++YYCURSOR;
@ -913,12 +920,12 @@ yyc_ST_DOUBLE_QUOTES:
yy61:
YYDEBUG(61, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 453 "Zend/zend_ini_scanner.l"
#line 460 "Zend/zend_ini_scanner.l"
{ /* Escape double quoted string contents */
zend_ini_escape_string(ini_lval, yytext, yyleng, '"' TSRMLS_CC);
return TC_QUOTED_STRING;
}
#line 922 "Zend/zend_ini_scanner.c"
#line 929 "Zend/zend_ini_scanner.c"
yy62:
YYDEBUG(62, *YYCURSOR);
++YYCURSOR;
@ -927,12 +934,12 @@ yy62:
yy63:
YYDEBUG(63, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 458 "Zend/zend_ini_scanner.l"
#line 465 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string ends */
yy_pop_state(TSRMLS_C);
return '"';
}
#line 936 "Zend/zend_ini_scanner.c"
#line 943 "Zend/zend_ini_scanner.c"
yy64:
YYDEBUG(64, *YYCURSOR);
++YYCURSOR;
@ -956,11 +963,11 @@ yy64:
yy65:
YYDEBUG(65, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 964 "Zend/zend_ini_scanner.c"
#line 971 "Zend/zend_ini_scanner.c"
yy66:
YYDEBUG(66, *YYCURSOR);
yych = *++YYCURSOR;
@ -1054,12 +1061,12 @@ yy78:
++YYCURSOR;
YYDEBUG(79, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 363 "Zend/zend_ini_scanner.l"
#line 370 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 1063 "Zend/zend_ini_scanner.c"
#line 1070 "Zend/zend_ini_scanner.c"
yy80:
YYDEBUG(80, *YYCURSOR);
++YYCURSOR;
@ -1158,11 +1165,11 @@ yy84:
yy85:
YYDEBUG(85, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 444 "Zend/zend_ini_scanner.l"
#line 451 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 1166 "Zend/zend_ini_scanner.c"
#line 1173 "Zend/zend_ini_scanner.c"
yy86:
YYDEBUG(86, *YYCURSOR);
yyaccept = 0;
@ -1179,23 +1186,23 @@ yy87:
yy88:
YYDEBUG(88, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 1187 "Zend/zend_ini_scanner.c"
#line 1194 "Zend/zend_ini_scanner.c"
yy89:
YYDEBUG(89, *YYCURSOR);
++YYCURSOR;
yy90:
YYDEBUG(90, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 448 "Zend/zend_ini_scanner.l"
#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 1199 "Zend/zend_ini_scanner.c"
#line 1206 "Zend/zend_ini_scanner.c"
yy91:
YYDEBUG(91, *YYCURSOR);
yych = *++YYCURSOR;
@ -1268,11 +1275,11 @@ yy95:
yy96:
YYDEBUG(96, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 422 "Zend/zend_ini_scanner.l"
#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 1276 "Zend/zend_ini_scanner.c"
#line 1283 "Zend/zend_ini_scanner.c"
yy97:
YYDEBUG(97, *YYCURSOR);
yyaccept = 3;
@ -1298,11 +1305,11 @@ yy97:
yy98:
YYDEBUG(98, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 418 "Zend/zend_ini_scanner.l"
#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 1306 "Zend/zend_ini_scanner.c"
#line 1313 "Zend/zend_ini_scanner.c"
yy99:
YYDEBUG(99, *YYCURSOR);
yych = *++YYCURSOR;
@ -1313,12 +1320,12 @@ yy100:
yy101:
YYDEBUG(101, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 358 "Zend/zend_ini_scanner.l"
#line 365 "Zend/zend_ini_scanner.l"
{ /* End of section or an option offset */
BEGIN(INITIAL);
return ']';
}
#line 1322 "Zend/zend_ini_scanner.c"
#line 1329 "Zend/zend_ini_scanner.c"
yy102:
YYDEBUG(102, *YYCURSOR);
yyaccept = 0;
@ -1617,7 +1624,7 @@ yy123:
++YYCURSOR;
YYDEBUG(126, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 333 "Zend/zend_ini_scanner.l"
#line 340 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@ -1626,18 +1633,18 @@ yy123:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1630 "Zend/zend_ini_scanner.c"
#line 1637 "Zend/zend_ini_scanner.c"
yy127:
YYDEBUG(127, *YYCURSOR);
++YYCURSOR;
YYDEBUG(128, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 363 "Zend/zend_ini_scanner.l"
#line 370 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 1641 "Zend/zend_ini_scanner.c"
#line 1648 "Zend/zend_ini_scanner.c"
yy129:
YYDEBUG(129, *YYCURSOR);
yyaccept = 0;
@ -1744,7 +1751,7 @@ yy135:
yy136:
YYDEBUG(136, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 398 "Zend/zend_ini_scanner.l"
#line 405 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
/* Eat leading and trailing double quotes */
if (yytext[0] == '"' && yytext[yyleng - 1] == '"') {
@ -1754,7 +1761,7 @@ yy136:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1758 "Zend/zend_ini_scanner.c"
#line 1765 "Zend/zend_ini_scanner.c"
yy137:
YYDEBUG(137, *YYCURSOR);
yyaccept = 0;
@ -1776,13 +1783,13 @@ yy138:
yy139:
YYDEBUG(139, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 412 "Zend/zend_ini_scanner.l"
#line 419 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 1786 "Zend/zend_ini_scanner.c"
#line 1793 "Zend/zend_ini_scanner.c"
yy140:
YYDEBUG(140, *YYCURSOR);
yych = *++YYCURSOR;
@ -1796,12 +1803,12 @@ yy141:
yy142:
YYDEBUG(142, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 483 "Zend/zend_ini_scanner.l"
#line 490 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL) */
BEGIN(INITIAL);
return 0;
}
#line 1805 "Zend/zend_ini_scanner.c"
#line 1812 "Zend/zend_ini_scanner.c"
yy143:
YYDEBUG(143, *YYCURSOR);
yych = *++YYCURSOR;
@ -1823,13 +1830,13 @@ yy146:
yy147:
YYDEBUG(147, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 1833 "Zend/zend_ini_scanner.c"
#line 1840 "Zend/zend_ini_scanner.c"
yy148:
YYDEBUG(148, *YYCURSOR);
yych = *++YYCURSOR;
@ -1931,21 +1938,21 @@ yyc_ST_SECTION_RAW:
yy158:
YYDEBUG(158, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 408 "Zend/zend_ini_scanner.l"
#line 415 "Zend/zend_ini_scanner.l"
{ /* Raw value, only used when SCNG(scanner_mode) == ZEND_INI_SCANNER_RAW. */
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 1939 "Zend/zend_ini_scanner.c"
#line 1946 "Zend/zend_ini_scanner.c"
yy159:
YYDEBUG(159, *YYCURSOR);
++YYCURSOR;
YYDEBUG(160, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 1949 "Zend/zend_ini_scanner.c"
#line 1956 "Zend/zend_ini_scanner.c"
yy161:
YYDEBUG(161, *YYCURSOR);
++YYCURSOR;
@ -1954,13 +1961,13 @@ yy161:
yy162:
YYDEBUG(162, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 342 "Zend/zend_ini_scanner.l"
#line 349 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 1964 "Zend/zend_ini_scanner.c"
#line 1971 "Zend/zend_ini_scanner.c"
yy163:
YYDEBUG(163, *YYCURSOR);
++YYCURSOR;
@ -2081,11 +2088,11 @@ yy171:
yy172:
YYDEBUG(172, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 444 "Zend/zend_ini_scanner.l"
#line 451 "Zend/zend_ini_scanner.l"
{ /* Get rest as section/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 2089 "Zend/zend_ini_scanner.c"
#line 2096 "Zend/zend_ini_scanner.c"
yy173:
YYDEBUG(173, *YYCURSOR);
yyaccept = 0;
@ -2104,23 +2111,23 @@ yy174:
yy175:
YYDEBUG(175, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 2112 "Zend/zend_ini_scanner.c"
#line 2119 "Zend/zend_ini_scanner.c"
yy176:
YYDEBUG(176, *YYCURSOR);
++YYCURSOR;
yy177:
YYDEBUG(177, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 448 "Zend/zend_ini_scanner.l"
#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 2124 "Zend/zend_ini_scanner.c"
#line 2131 "Zend/zend_ini_scanner.c"
yy178:
YYDEBUG(178, *YYCURSOR);
yych = *++YYCURSOR;
@ -2193,11 +2200,11 @@ yy182:
yy183:
YYDEBUG(183, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 422 "Zend/zend_ini_scanner.l"
#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 2201 "Zend/zend_ini_scanner.c"
#line 2208 "Zend/zend_ini_scanner.c"
yy184:
YYDEBUG(184, *YYCURSOR);
yyaccept = 3;
@ -2223,11 +2230,11 @@ yy184:
yy185:
YYDEBUG(185, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 418 "Zend/zend_ini_scanner.l"
#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 2231 "Zend/zend_ini_scanner.c"
#line 2238 "Zend/zend_ini_scanner.c"
yy186:
YYDEBUG(186, *YYCURSOR);
yych = *++YYCURSOR;
@ -2240,13 +2247,13 @@ yy187:
yy188:
YYDEBUG(188, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 342 "Zend/zend_ini_scanner.l"
#line 349 "Zend/zend_ini_scanner.l"
{ /* End of section */
BEGIN(INITIAL);
SCNG(lineno)++;
return ']';
}
#line 2250 "Zend/zend_ini_scanner.c"
#line 2257 "Zend/zend_ini_scanner.c"
yy189:
YYDEBUG(189, *YYCURSOR);
++YYCURSOR;
@ -2567,7 +2574,7 @@ yy214:
++YYCURSOR;
YYDEBUG(217, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 333 "Zend/zend_ini_scanner.l"
#line 340 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@ -2576,18 +2583,18 @@ yy214:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 2580 "Zend/zend_ini_scanner.c"
#line 2587 "Zend/zend_ini_scanner.c"
yy218:
YYDEBUG(218, *YYCURSOR);
++YYCURSOR;
YYDEBUG(219, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 363 "Zend/zend_ini_scanner.l"
#line 370 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 2591 "Zend/zend_ini_scanner.c"
#line 2598 "Zend/zend_ini_scanner.c"
yy220:
YYDEBUG(220, *YYCURSOR);
yyaccept = 0;
@ -2766,12 +2773,12 @@ yy225:
yy226:
YYDEBUG(226, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 483 "Zend/zend_ini_scanner.l"
#line 490 "Zend/zend_ini_scanner.l"
{ /* End of option value (if EOF is reached before EOL) */
BEGIN(INITIAL);
return 0;
}
#line 2775 "Zend/zend_ini_scanner.c"
#line 2782 "Zend/zend_ini_scanner.c"
yy227:
YYDEBUG(227, *YYCURSOR);
yyaccept = 0;
@ -2780,11 +2787,11 @@ yy227:
yy228:
YYDEBUG(228, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 440 "Zend/zend_ini_scanner.l"
#line 447 "Zend/zend_ini_scanner.l"
{ /* Get everything else as option/offset value */
RETURN_TOKEN(TC_STRING, yytext, yyleng);
}
#line 2788 "Zend/zend_ini_scanner.c"
#line 2795 "Zend/zend_ini_scanner.c"
yy229:
YYDEBUG(229, *YYCURSOR);
yyaccept = 1;
@ -2793,24 +2800,24 @@ yy229:
yy230:
YYDEBUG(230, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 463 "Zend/zend_ini_scanner.l"
#line 470 "Zend/zend_ini_scanner.l"
{
RETURN_TOKEN(TC_WHITESPACE, yytext, yyleng);
}
#line 2801 "Zend/zend_ini_scanner.c"
#line 2808 "Zend/zend_ini_scanner.c"
yy231:
YYDEBUG(231, *YYCURSOR);
++YYCURSOR;
yy232:
YYDEBUG(232, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 412 "Zend/zend_ini_scanner.l"
#line 419 "Zend/zend_ini_scanner.l"
{ /* End of option value */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 2814 "Zend/zend_ini_scanner.c"
#line 2821 "Zend/zend_ini_scanner.c"
yy233:
YYDEBUG(233, *YYCURSOR);
yych = *++YYCURSOR;
@ -2824,23 +2831,23 @@ yy234:
yy235:
YYDEBUG(235, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 430 "Zend/zend_ini_scanner.l"
#line 437 "Zend/zend_ini_scanner.l"
{ /* Boolean operators */
return yytext[0];
}
#line 2832 "Zend/zend_ini_scanner.c"
#line 2839 "Zend/zend_ini_scanner.c"
yy236:
YYDEBUG(236, *YYCURSOR);
++YYCURSOR;
yy237:
YYDEBUG(237, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 448 "Zend/zend_ini_scanner.l"
#line 455 "Zend/zend_ini_scanner.l"
{ /* Double quoted '"' string start */
yy_push_state(ST_DOUBLE_QUOTES TSRMLS_CC);
return '"';
}
#line 2844 "Zend/zend_ini_scanner.c"
#line 2851 "Zend/zend_ini_scanner.c"
yy238:
YYDEBUG(238, *YYCURSOR);
yych = *++YYCURSOR;
@ -2927,11 +2934,11 @@ yy242:
yy243:
YYDEBUG(243, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 422 "Zend/zend_ini_scanner.l"
#line 429 "Zend/zend_ini_scanner.l"
{ /* Get number option value as string */
RETURN_TOKEN(TC_NUMBER, yytext, yyleng);
}
#line 2935 "Zend/zend_ini_scanner.c"
#line 2942 "Zend/zend_ini_scanner.c"
yy244:
YYDEBUG(244, *YYCURSOR);
yyaccept = 2;
@ -2942,13 +2949,13 @@ yy245:
++YYCURSOR;
YYDEBUG(246, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 434 "Zend/zend_ini_scanner.l"
#line 441 "Zend/zend_ini_scanner.l"
{ /* Make = used in option value to trigger error */
yyless(0);
BEGIN(INITIAL);
return END_OF_LINE;
}
#line 2952 "Zend/zend_ini_scanner.c"
#line 2959 "Zend/zend_ini_scanner.c"
yy247:
YYDEBUG(247, *YYCURSOR);
yyaccept = 4;
@ -2984,11 +2991,11 @@ yy247:
yy248:
YYDEBUG(248, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 418 "Zend/zend_ini_scanner.l"
#line 425 "Zend/zend_ini_scanner.l"
{ /* Get constant option value */
RETURN_TOKEN(TC_CONSTANT, yytext, yyleng);
}
#line 2992 "Zend/zend_ini_scanner.c"
#line 2999 "Zend/zend_ini_scanner.c"
yy249:
YYDEBUG(249, *YYCURSOR);
yyaccept = 4;
@ -3489,11 +3496,11 @@ yy264:
yy265:
YYDEBUG(265, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 377 "Zend/zend_ini_scanner.l"
#line 384 "Zend/zend_ini_scanner.l"
{ /* TRUE value (when used outside option value/offset this causes parse error!) */
RETURN_TOKEN(BOOL_TRUE, "1", 1);
}
#line 3497 "Zend/zend_ini_scanner.c"
#line 3504 "Zend/zend_ini_scanner.c"
yy266:
YYDEBUG(266, *YYCURSOR);
++YYCURSOR;
@ -3693,11 +3700,11 @@ yy271:
yy272:
YYDEBUG(272, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 381 "Zend/zend_ini_scanner.l"
#line 388 "Zend/zend_ini_scanner.l"
{ /* FALSE value (when used outside option value/offset this causes parse error!)*/
RETURN_TOKEN(BOOL_FALSE, "", 0);
}
#line 3701 "Zend/zend_ini_scanner.c"
#line 3708 "Zend/zend_ini_scanner.c"
yy273:
YYDEBUG(273, *YYCURSOR);
++YYCURSOR;
@ -4073,13 +4080,13 @@ yy284:
yy285:
YYDEBUG(285, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 477 "Zend/zend_ini_scanner.l"
#line 484 "Zend/zend_ini_scanner.l"
{ /* Comment */
BEGIN(INITIAL);
SCNG(lineno)++;
return END_OF_LINE;
}
#line 4083 "Zend/zend_ini_scanner.c"
#line 4090 "Zend/zend_ini_scanner.c"
yy286:
YYDEBUG(286, *YYCURSOR);
yych = *++YYCURSOR;
@ -4291,7 +4298,7 @@ yy295:
++YYCURSOR;
YYDEBUG(298, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 333 "Zend/zend_ini_scanner.l"
#line 340 "Zend/zend_ini_scanner.l"
{ /* Raw string */
/* Eat leading and trailing single quotes */
if (yytext[0] == '\'' && yytext[yyleng - 1] == '\'') {
@ -4300,18 +4307,18 @@ yy295:
}
RETURN_TOKEN(TC_RAW, yytext, yyleng);
}
#line 4304 "Zend/zend_ini_scanner.c"
#line 4311 "Zend/zend_ini_scanner.c"
yy299:
YYDEBUG(299, *YYCURSOR);
++YYCURSOR;
YYDEBUG(300, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 363 "Zend/zend_ini_scanner.l"
#line 370 "Zend/zend_ini_scanner.l"
{ /* Variable start */
yy_push_state(ST_VARNAME TSRMLS_CC);
return TC_DOLLAR_CURLY;
}
#line 4315 "Zend/zend_ini_scanner.c"
#line 4322 "Zend/zend_ini_scanner.c"
yy301:
YYDEBUG(301, *YYCURSOR);
++YYCURSOR;
@ -4417,11 +4424,11 @@ yy310:
++YYCURSOR;
YYDEBUG(311, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 488 "Zend/zend_ini_scanner.l"
#line 495 "Zend/zend_ini_scanner.l"
{
return 0;
}
#line 4425 "Zend/zend_ini_scanner.c"
#line 4432 "Zend/zend_ini_scanner.c"
yy312:
YYDEBUG(312, *YYCURSOR);
++YYCURSOR;
@ -4430,22 +4437,22 @@ yy312:
yy313:
YYDEBUG(313, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 368 "Zend/zend_ini_scanner.l"
#line 375 "Zend/zend_ini_scanner.l"
{ /* Variable name */
RETURN_TOKEN(TC_VARNAME, yytext, yyleng);
}
#line 4438 "Zend/zend_ini_scanner.c"
#line 4445 "Zend/zend_ini_scanner.c"
yy314:
YYDEBUG(314, *YYCURSOR);
++YYCURSOR;
YYDEBUG(315, *YYCURSOR);
yyleng = YYCURSOR - SCNG(yy_text);
#line 372 "Zend/zend_ini_scanner.l"
#line 379 "Zend/zend_ini_scanner.l"
{ /* Variable end */
yy_pop_state(TSRMLS_C);
return '}';
}
#line 4449 "Zend/zend_ini_scanner.c"
#line 4456 "Zend/zend_ini_scanner.c"
yy316:
YYDEBUG(316, *YYCURSOR);
++YYCURSOR;
@ -4459,6 +4466,6 @@ yy317:
goto yy313;
}
}
#line 492 "Zend/zend_ini_scanner.l"
#line 499 "Zend/zend_ini_scanner.l"
}

View File

@ -22,6 +22,11 @@
/* $Id$ */
#include <errno.h>
#include "zend.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
#if 0
# define YYDEBUG(s, c) printf("state: %d char: %c\n", s, c)
@ -50,6 +55,14 @@
#define yyless(x) YYCURSOR = yytext + x
/* #define yymore() goto yymore_restart */
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
/*!max:re2c */
#if ZEND_MMAP_AHEAD < YYMAXFILL
# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
#endif
/* How it works (for the core ini directives):
* ===========================================
*
@ -80,12 +93,6 @@
*
*/
#include <errno.h>
#include "zend.h"
#include "zend_globals.h"
#include <zend_ini_parser.h>
#include "zend_ini_scanner.h"
/* Globals Macros */
#define SCNG INI_SCNG
#ifdef ZTS

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.4.dev on Wed Mar 26 15:14:24 2008 */
/* Generated by re2c 0.13.4.dev on Fri Apr 4 16:10:13 2008 */
#line 3 "Zend/zend_ini_scanner_defs.h"
enum YYCONDTYPE {

File diff suppressed because it is too large Load Diff

View File

@ -66,6 +66,13 @@
#define yyless(x) YYCURSOR = yytext + x
#define yymore() goto yymore_restart
/* perform sanity check. If this message is triggered you should
increase the ZEND_MMAP_AHEAD value in the zend_streams.h file */
/*!max:re2c */
#if ZEND_MMAP_AHEAD < YYMAXFILL
# error ZEND_MMAP_AHEAD should be greater than or equal to YYMAXFILL
#endif
#ifdef HAVE_STDARG_H
# include <stdarg.h>
#endif
@ -833,10 +840,8 @@ ZEND_API int zend_prepare_string_for_scanning(zval *str, char *filename TSRMLS_D
encoding = ucnv_getName(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &status);
}
/* enforce two trailing NULLs for flex... */
STR_REALLOC(Z_STRVAL_P(str), Z_STRLEN_P(str)+2);
Z_STRVAL_P(str)[Z_STRLEN_P(str)+1]=0;
str->value.str.val = safe_erealloc(str->value.str.val, 1, str->value.str.len, ZEND_MMAP_AHEAD);
memset(str->value.str.val + str->value.str.len, 0, ZEND_MMAP_AHEAD);
SCNG(yy_in)=NULL;

View File

@ -1,4 +1,4 @@
/* Generated by re2c 0.13.4.dev on Wed Mar 26 15:13:41 2008 */
/* Generated by re2c 0.13.4.dev on Fri Apr 4 16:08:19 2008 */
#line 3 "Zend/zend_language_scanner_defs.h"
enum YYCONDTYPE {

View File

@ -29,7 +29,7 @@ typedef size_t (*zend_stream_fsizer_t)(void* handle TSRMLS_DC);
typedef size_t (*zend_stream_reader_t)(void* handle, char *buf, size_t len TSRMLS_DC);
typedef void (*zend_stream_closer_t)(void* handle TSRMLS_DC);
#define ZEND_MMAP_AHEAD 32
#define ZEND_MMAP_AHEAD 16
typedef enum {
ZEND_HANDLE_FILENAME,