cvs: ZendEngine2(PHP_5_2) / zend.h zend_ini_parser.y zend_ini_scanner.l zend_strtod.c
| From: | Jani Taskinen | Date: | Mon, 23 Jul 2007 16:17:10 +0000 |
| Subject: | cvs: ZendEngine2(PHP_5_2) / zend.h zend_ini_parser.y zend_ini_scanner.l zend_strtod.c | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-5919@lists.php.net to get a copy of this message | ||
jani Mon Jul 23 16:17:10 2007 UTC
Modified files: (Branch: PHP_5_2)
/ZendEngine2 zend.h zend_ini_parser.y zend_ini_scanner.l
zend_strtod.c
Log:
MFH: - Fixed buf #42071 (ini scanner allows using NULL as option name).
MFH: Use Z_* macros to access the zvals.
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.293.2.11.2.8&r2=1.293.2.11.2.9&diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.293.2.11.2.8 ZendEngine2/zend.h:1.293.2.11.2.9 --- ZendEngine2/zend.h:1.293.2.11.2.8 Thu Apr 26 19:08:58 2007 +++ ZendEngine2/zend.h Mon Jul 23 16:17:10 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.293.2.11.2.8 2007/04/26 19:08:58 tony2001 Exp $ */ +/* $Id: zend.h,v 1.293.2.11.2.9 2007/07/23 16:17:10 jani Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -648,6 +648,7 @@ #define ZEND_MAX_RESERVED_RESOURCES 4 +#include "zend_operators.h" #include "zend_variables.h" #endif /* ZEND_H */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_parser.y?r1=1.41.2.2.2.1&r2=1.41.2.2.2.2&diff_format=u Index: ZendEngine2/zend_ini_parser.y diff -u ZendEngine2/zend_ini_parser.y:1.41.2.2.2.1 ZendEngine2/zend_ini_parser.y:1.41.2.2.2.2 --- ZendEngine2/zend_ini_parser.y:1.41.2.2.2.1 Tue Sep 19 20:33:12 2006 +++ ZendEngine2/zend_ini_parser.y Mon Jul 23 16:17:10 2007 @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini_parser.y,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */ +/* $Id: zend_ini_parser.y,v 1.41.2.2.2.2 2007/07/23 16:17:10 jani Exp $ */ #define DEBUG_CFG_PARSER 0 #include "zend.h" @@ -58,11 +58,11 @@ int i_op1, i_op2; char str_result[MAX_LENGTH_OF_LONG]; - i_op1 = atoi(op1->value.str.val); - free(op1->value.str.val); + i_op1 = atoi(Z_STRVAL_P(op1)); + free(Z_STRVAL_P(op1)); if (op2) { - i_op2 = atoi(op2->value.str.val); - free(op2->value.str.val); + i_op2 = atoi(Z_STRVAL_P(op2)); + free(Z_STRVAL_P(op2)); } else { i_op2 = 0; } @@ -85,30 +85,30 @@ break; } - result->value.str.len = zend_sprintf(str_result, "%d", i_result); - result->value.str.val = (char *) malloc(result->value.str.len+1); - memcpy(result->value.str.val, str_result, result->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; + Z_STRLEN_P(result) = zend_sprintf(str_result, "%d", i_result); + Z_STRVAL_P(result) = (char *) malloc(Z_STRLEN_P(result)+1); + memcpy(Z_STRVAL_P(result), str_result, Z_STRLEN_P(result)); + Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_init_string(zval *result) { - result->value.str.val = malloc(1); - result->value.str.val[0] = 0; - result->value.str.len = 0; - result->type = IS_STRING; + Z_STRVAL_P(result) = malloc(1); + Z_STRVAL_P(result)[0] = 0; + Z_STRLEN_P(result) = 0; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_add_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; +{ + int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); - result->value.str.val = (char *) realloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; + Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1); + memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + Z_STRVAL_P(result)[length] = 0; + Z_STRLEN_P(result) = length; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_get_constant(zval *result, zval *name) @@ -116,15 +116,15 @@ zval z_constant; TSRMLS_FETCH(); - if (!memchr(name->value.str.val, ':', name->value.str.len) - && zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) { + if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name)) + && zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) { /* z_constant is emalloc()'d */ convert_to_string(&z_constant); - result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len); - result->value.str.len = z_constant.value.str.len; - result->type = z_constant.type; + Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant)); + Z_STRLEN_P(result) = Z_STRLEN(z_constant); + Z_TYPE_P(result) = Z_TYPE(z_constant); zval_dtor(&z_constant); - free(name->value.str.val); + free(Z_STRVAL_P(name)); } else { *result = *name; } @@ -136,13 +136,13 @@ char *envvar; TSRMLS_FETCH(); - if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) { - result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len); - result->value.str.len = curval.value.str.len; - } else if ((envvar = zend_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || - (envvar = getenv(name->value.str.val)) != NULL) { - result->value.str.val = strdup(envvar); - result->value.str.len = strlen(envvar); + if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name)+1, &curval) == SUCCESS) { + Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRLEN(curval)); + Z_STRLEN_P(result) = Z_STRLEN(curval); + } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL || + (envvar = getenv(Z_STRVAL_P(name))) != NULL) { + Z_STRVAL_P(result) = strdup(envvar); + Z_STRLEN_P(result) = strlen(envvar); } else { zend_ini_init_string(result); } @@ -252,22 +252,22 @@ statement: TC_STRING '=' string_or_value { #if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val); + printf("'%s' = '%s'\n", Z_STRVAL($1), Z_STRVAL($3)); #endif ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($3.value.str.val); + free(Z_STRVAL($1)); + free(Z_STRVAL($3)); } | TC_STRING BRACK '=' string_or_value { #if DEBUG_CFG_PARSER - printf("'%s'[ ] = '%s'\n", $1.value.str.val, $4.value.str.val); + printf("'%s'[ ] = '%s'\n", Z_STRVAL($1), Z_STRVAL($4)); #endif ZEND_INI_PARSER_CB(&$1, &$4, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($4.value.str.val); + free(Z_STRVAL($1)); + free(Z_STRVAL($4)); } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); } + | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } + | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } | '\n' ; @@ -286,7 +286,7 @@ | TC_ENCAPSULATED_STRING { $$ = $1; } | constant_string { $$ = $1; } | var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } + | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); } | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } ; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_scanner.l?r1=1.41.2.2.2.1&r2=1.41.2.2.2.2&diff_format=u Index: ZendEngine2/zend_ini_scanner.l diff -u ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.1 ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.2 --- ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.1 Tue Sep 19 20:33:12 2006 +++ ZendEngine2/zend_ini_scanner.l Mon Jul 23 16:17:10 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */ +/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.2 2007/07/23 16:17:10 jani Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -48,6 +48,10 @@ ZEND_API zend_scanner_globals ini_scanner_globals; #endif +# define YY_INPUT(buf, result, max_size) \ + if ( ((result = zend_stream_read(yyin, buf, max_size TSRMLS_CC)) == 0) \ + && zend_stream_ferror( yyin TSRMLS_CC) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); static char *ini_filename; @@ -56,19 +60,16 @@ SCNG(lineno)=1; } - int zend_ini_scanner_get_lineno(TSRMLS_D) { return SCNG(lineno); } - char *zend_ini_scanner_get_filename(TSRMLS_D) { return ini_filename; } - int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) { if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) { @@ -82,7 +83,6 @@ return SUCCESS; } - int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC) { int len = strlen(str); @@ -93,7 +93,6 @@ return SUCCESS; } - void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) { zend_stream_close(fh); @@ -113,17 +112,17 @@ } <INITIAL>[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1", 1); - ini_lval->value.str.len = 1; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup("1", 1); + Z_STRLEN_P(ini_lval) = 1; + Z_TYPE_P(ini_lval) = IS_STRING; return CFG_TRUE; } -<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("", 0); - ini_lval->value.str.len = 0; - ini_lval->type = IS_STRING; +<INITIAL>[ ]*("false"|"off"|"no"|"none"|"null")[ ]* { + Z_STRVAL_P(ini_lval) = zend_strndup("", 0); + Z_STRLEN_P(ini_lval) = 0; + Z_TYPE_P(ini_lval) = IS_STRING; return CFG_FALSE; } @@ -142,13 +141,12 @@ yytext++; yyleng--; - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); + Z_STRLEN_P(ini_lval) = yyleng; + Z_TYPE_P(ini_lval) = IS_STRING; return SECTION; } - <INITIAL>["][^"]*["] { char *p = yytext; @@ -168,22 +166,22 @@ /* eat leading " */ yytext++; - ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2); - ini_lval->value.str.len = yyleng - 2; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng - 2); + Z_STRLEN_P(ini_lval) = yyleng - 2; + Z_TYPE_P(ini_lval) = IS_STRING; return TC_ENCAPSULATED_STRING; } -<INITIAL>[&|~$(){}!] { - return yytext[0]; -} - <INITIAL>"${" { return TC_DOLLAR_CURLY; } <INITIAL>"}" { - ini_lval->value.lval = (long) yytext[0]; + Z_LVAL_P(ini_lval) = (long) yytext[0]; + return yytext[0]; +} + +<INITIAL>[&|~$(){}!] { return yytext[0]; } @@ -210,9 +208,9 @@ } } if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); + Z_STRLEN_P(ini_lval) = yyleng; + Z_TYPE_P(ini_lval) = IS_STRING; return TC_STRING; } else { /* whitespace */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_strtod.c?r1=1.17.2.2.2.11&r2=1.17.2.2.2.12&diff_format=u Index: ZendEngine2/zend_strtod.c diff -u ZendEngine2/zend_strtod.c:1.17.2.2.2.11 ZendEngine2/zend_strtod.c:1.17.2.2.2.12 --- ZendEngine2/zend_strtod.c:1.17.2.2.2.11 Fri May 4 16:19:57 2007 +++ ZendEngine2/zend_strtod.c Mon Jul 23 16:17:10 2007 @@ -89,8 +89,9 @@ * directly -- and assumed always to succeed. */ -/* $Id: zend_strtod.c,v 1.17.2.2.2.11 2007/05/04 16:19:57 tony2001 Exp $ */ +/* $Id: zend_strtod.c,v 1.17.2.2.2.12 2007/07/23 16:17:10 jani Exp $ */ +#include <zend_operators.h> #include <zend_strtod.h> #ifdef ZTS
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend.h?r1=1.293.2.11.2.8&r2=1.293.2.11.2.9&diff_format=u Index: ZendEngine2/zend.h diff -u ZendEngine2/zend.h:1.293.2.11.2.8 ZendEngine2/zend.h:1.293.2.11.2.9 --- ZendEngine2/zend.h:1.293.2.11.2.8 Thu Apr 26 19:08:58 2007 +++ ZendEngine2/zend.h Mon Jul 23 16:17:10 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend.h,v 1.293.2.11.2.8 2007/04/26 19:08:58 tony2001 Exp $ */ +/* $Id: zend.h,v 1.293.2.11.2.9 2007/07/23 16:17:10 jani Exp $ */ #ifndef ZEND_H #define ZEND_H @@ -648,6 +648,7 @@ #define ZEND_MAX_RESERVED_RESOURCES 4 +#include "zend_operators.h" #include "zend_variables.h" #endif /* ZEND_H */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_parser.y?r1=1.41.2.2.2.1&r2=1.41.2.2.2.2&diff_format=u Index: ZendEngine2/zend_ini_parser.y diff -u ZendEngine2/zend_ini_parser.y:1.41.2.2.2.1 ZendEngine2/zend_ini_parser.y:1.41.2.2.2.2 --- ZendEngine2/zend_ini_parser.y:1.41.2.2.2.1 Tue Sep 19 20:33:12 2006 +++ ZendEngine2/zend_ini_parser.y Mon Jul 23 16:17:10 2007 @@ -3,7 +3,7 @@ +----------------------------------------------------------------------+ | Zend Engine | +----------------------------------------------------------------------+ - | Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) | + | Copyright (c) 1998-2007 Zend Technologies Ltd. (http://www.zend.com) | +----------------------------------------------------------------------+ | This source file is subject to version 2.00 of the Zend license, | | that is bundled with this package in the file LICENSE, and is | @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini_parser.y,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */ +/* $Id: zend_ini_parser.y,v 1.41.2.2.2.2 2007/07/23 16:17:10 jani Exp $ */ #define DEBUG_CFG_PARSER 0 #include "zend.h" @@ -58,11 +58,11 @@ int i_op1, i_op2; char str_result[MAX_LENGTH_OF_LONG]; - i_op1 = atoi(op1->value.str.val); - free(op1->value.str.val); + i_op1 = atoi(Z_STRVAL_P(op1)); + free(Z_STRVAL_P(op1)); if (op2) { - i_op2 = atoi(op2->value.str.val); - free(op2->value.str.val); + i_op2 = atoi(Z_STRVAL_P(op2)); + free(Z_STRVAL_P(op2)); } else { i_op2 = 0; } @@ -85,30 +85,30 @@ break; } - result->value.str.len = zend_sprintf(str_result, "%d", i_result); - result->value.str.val = (char *) malloc(result->value.str.len+1); - memcpy(result->value.str.val, str_result, result->value.str.len); - result->value.str.val[result->value.str.len] = 0; - result->type = IS_STRING; + Z_STRLEN_P(result) = zend_sprintf(str_result, "%d", i_result); + Z_STRVAL_P(result) = (char *) malloc(Z_STRLEN_P(result)+1); + memcpy(Z_STRVAL_P(result), str_result, Z_STRLEN_P(result)); + Z_STRVAL_P(result)[Z_STRLEN_P(result)] = 0; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_init_string(zval *result) { - result->value.str.val = malloc(1); - result->value.str.val[0] = 0; - result->value.str.len = 0; - result->type = IS_STRING; + Z_STRVAL_P(result) = malloc(1); + Z_STRVAL_P(result)[0] = 0; + Z_STRLEN_P(result) = 0; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_add_string(zval *result, zval *op1, zval *op2) -{ - int length = op1->value.str.len + op2->value.str.len; +{ + int length = Z_STRLEN_P(op1) + Z_STRLEN_P(op2); - result->value.str.val = (char *) realloc(op1->value.str.val, length+1); - memcpy(result->value.str.val+op1->value.str.len, op2->value.str.val, op2->value.str.len); - result->value.str.val[length] = 0; - result->value.str.len = length; - result->type = IS_STRING; + Z_STRVAL_P(result) = (char *) realloc(Z_STRVAL_P(op1), length+1); + memcpy(Z_STRVAL_P(result)+Z_STRLEN_P(op1), Z_STRVAL_P(op2), Z_STRLEN_P(op2)); + Z_STRVAL_P(result)[length] = 0; + Z_STRLEN_P(result) = length; + Z_TYPE_P(result) = IS_STRING; } void zend_ini_get_constant(zval *result, zval *name) @@ -116,15 +116,15 @@ zval z_constant; TSRMLS_FETCH(); - if (!memchr(name->value.str.val, ':', name->value.str.len) - && zend_get_constant(name->value.str.val, name->value.str.len, &z_constant TSRMLS_CC)) { + if (!memchr(Z_STRVAL_P(name), ':', Z_STRLEN_P(name)) + && zend_get_constant(Z_STRVAL_P(name), Z_STRLEN_P(name), &z_constant TSRMLS_CC)) { /* z_constant is emalloc()'d */ convert_to_string(&z_constant); - result->value.str.val = zend_strndup(z_constant.value.str.val, z_constant.value.str.len); - result->value.str.len = z_constant.value.str.len; - result->type = z_constant.type; + Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(z_constant), Z_STRLEN(z_constant)); + Z_STRLEN_P(result) = Z_STRLEN(z_constant); + Z_TYPE_P(result) = Z_TYPE(z_constant); zval_dtor(&z_constant); - free(name->value.str.val); + free(Z_STRVAL_P(name)); } else { *result = *name; } @@ -136,13 +136,13 @@ char *envvar; TSRMLS_FETCH(); - if (zend_get_configuration_directive(name->value.str.val, name->value.str.len+1, &curval) == SUCCESS) { - result->value.str.val = zend_strndup(curval.value.str.val, curval.value.str.len); - result->value.str.len = curval.value.str.len; - } else if ((envvar = zend_getenv(name->value.str.val, name->value.str.len TSRMLS_CC)) != NULL || - (envvar = getenv(name->value.str.val)) != NULL) { - result->value.str.val = strdup(envvar); - result->value.str.len = strlen(envvar); + if (zend_get_configuration_directive(Z_STRVAL_P(name), Z_STRLEN_P(name)+1, &curval) == SUCCESS) { + Z_STRVAL_P(result) = zend_strndup(Z_STRVAL(curval), Z_STRLEN(curval)); + Z_STRLEN_P(result) = Z_STRLEN(curval); + } else if ((envvar = zend_getenv(Z_STRVAL_P(name), Z_STRLEN_P(name) TSRMLS_CC)) != NULL || + (envvar = getenv(Z_STRVAL_P(name))) != NULL) { + Z_STRVAL_P(result) = strdup(envvar); + Z_STRLEN_P(result) = strlen(envvar); } else { zend_ini_init_string(result); } @@ -252,22 +252,22 @@ statement: TC_STRING '=' string_or_value { #if DEBUG_CFG_PARSER - printf("'%s' = '%s'\n", $1.value.str.val, $3.value.str.val); + printf("'%s' = '%s'\n", Z_STRVAL($1), Z_STRVAL($3)); #endif ZEND_INI_PARSER_CB(&$1, &$3, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($3.value.str.val); + free(Z_STRVAL($1)); + free(Z_STRVAL($3)); } | TC_STRING BRACK '=' string_or_value { #if DEBUG_CFG_PARSER - printf("'%s'[ ] = '%s'\n", $1.value.str.val, $4.value.str.val); + printf("'%s'[ ] = '%s'\n", Z_STRVAL($1), Z_STRVAL($4)); #endif ZEND_INI_PARSER_CB(&$1, &$4, ZEND_INI_PARSER_POP_ENTRY, ZEND_INI_PARSER_ARG); - free($1.value.str.val); - free($4.value.str.val); + free(Z_STRVAL($1)); + free(Z_STRVAL($4)); } - | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free($1.value.str.val); } - | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free($1.value.str.val); } + | TC_STRING { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_ENTRY, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } + | SECTION { ZEND_INI_PARSER_CB(&$1, NULL, ZEND_INI_PARSER_SECTION, ZEND_INI_PARSER_ARG); free(Z_STRVAL($1)); } | '\n' ; @@ -286,7 +286,7 @@ | TC_ENCAPSULATED_STRING { $$ = $1; } | constant_string { $$ = $1; } | var_string_list cfg_var_ref { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } - | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } + | var_string_list TC_ENCAPSULATED_STRING { zend_ini_add_string(&$$, &$1, &$2); free(Z_STRVAL($2)); } | var_string_list constant_string { zend_ini_add_string(&$$, &$1, &$2); free($2.value.str.val); } ; http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_ini_scanner.l?r1=1.41.2.2.2.1&r2=1.41.2.2.2.2&diff_format=u Index: ZendEngine2/zend_ini_scanner.l diff -u ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.1 ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.2 --- ZendEngine2/zend_ini_scanner.l:1.41.2.2.2.1 Tue Sep 19 20:33:12 2006 +++ ZendEngine2/zend_ini_scanner.l Mon Jul 23 16:17:10 2007 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.1 2006/09/19 20:33:12 dmitry Exp $ */ +/* $Id: zend_ini_scanner.l,v 1.41.2.2.2.2 2007/07/23 16:17:10 jani Exp $ */ #define yyleng SCNG(yy_leng) #define yytext SCNG(yy_text) @@ -48,6 +48,10 @@ ZEND_API zend_scanner_globals ini_scanner_globals; #endif +# define YY_INPUT(buf, result, max_size) \ + if ( ((result = zend_stream_read(yyin, buf, max_size TSRMLS_CC)) == 0) \ + && zend_stream_ferror( yyin TSRMLS_CC) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); static char *ini_filename; @@ -56,19 +60,16 @@ SCNG(lineno)=1; } - int zend_ini_scanner_get_lineno(TSRMLS_D) { return SCNG(lineno); } - char *zend_ini_scanner_get_filename(TSRMLS_D) { return ini_filename; } - int zend_ini_open_file_for_scanning(zend_file_handle *fh TSRMLS_DC) { if (FAILURE == zend_stream_fixup(fh TSRMLS_CC)) { @@ -82,7 +83,6 @@ return SUCCESS; } - int zend_ini_prepare_string_for_scanning(char *str TSRMLS_DC) { int len = strlen(str); @@ -93,7 +93,6 @@ return SUCCESS; } - void zend_ini_close_file(zend_file_handle *fh TSRMLS_DC) { zend_stream_close(fh); @@ -113,17 +112,17 @@ } <INITIAL>[ ]*("true"|"on"|"yes")[ ]* { - ini_lval->value.str.val = zend_strndup("1", 1); - ini_lval->value.str.len = 1; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup("1", 1); + Z_STRLEN_P(ini_lval) = 1; + Z_TYPE_P(ini_lval) = IS_STRING; return CFG_TRUE; } -<INITIAL>[ ]*("false"|"off"|"no"|"none")[ ]* { - ini_lval->value.str.val = zend_strndup("", 0); - ini_lval->value.str.len = 0; - ini_lval->type = IS_STRING; +<INITIAL>[ ]*("false"|"off"|"no"|"none"|"null")[ ]* { + Z_STRVAL_P(ini_lval) = zend_strndup("", 0); + Z_STRLEN_P(ini_lval) = 0; + Z_TYPE_P(ini_lval) = IS_STRING; return CFG_FALSE; } @@ -142,13 +141,12 @@ yytext++; yyleng--; - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); + Z_STRLEN_P(ini_lval) = yyleng; + Z_TYPE_P(ini_lval) = IS_STRING; return SECTION; } - <INITIAL>["][^"]*["] { char *p = yytext; @@ -168,22 +166,22 @@ /* eat leading " */ yytext++; - ini_lval->value.str.val = zend_strndup(yytext, yyleng - 2); - ini_lval->value.str.len = yyleng - 2; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng - 2); + Z_STRLEN_P(ini_lval) = yyleng - 2; + Z_TYPE_P(ini_lval) = IS_STRING; return TC_ENCAPSULATED_STRING; } -<INITIAL>[&|~$(){}!] { - return yytext[0]; -} - <INITIAL>"${" { return TC_DOLLAR_CURLY; } <INITIAL>"}" { - ini_lval->value.lval = (long) yytext[0]; + Z_LVAL_P(ini_lval) = (long) yytext[0]; + return yytext[0]; +} + +<INITIAL>[&|~$(){}!] { return yytext[0]; } @@ -210,9 +208,9 @@ } } if (yyleng!=0) { - ini_lval->value.str.val = zend_strndup(yytext, yyleng); - ini_lval->value.str.len = yyleng; - ini_lval->type = IS_STRING; + Z_STRVAL_P(ini_lval) = zend_strndup(yytext, yyleng); + Z_STRLEN_P(ini_lval) = yyleng; + Z_TYPE_P(ini_lval) = IS_STRING; return TC_STRING; } else { /* whitespace */ http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_strtod.c?r1=1.17.2.2.2.11&r2=1.17.2.2.2.12&diff_format=u Index: ZendEngine2/zend_strtod.c diff -u ZendEngine2/zend_strtod.c:1.17.2.2.2.11 ZendEngine2/zend_strtod.c:1.17.2.2.2.12 --- ZendEngine2/zend_strtod.c:1.17.2.2.2.11 Fri May 4 16:19:57 2007 +++ ZendEngine2/zend_strtod.c Mon Jul 23 16:17:10 2007 @@ -89,8 +89,9 @@ * directly -- and assumed always to succeed. */ -/* $Id: zend_strtod.c,v 1.17.2.2.2.11 2007/05/04 16:19:57 tony2001 Exp $ */ +/* $Id: zend_strtod.c,v 1.17.2.2.2.12 2007/07/23 16:17:10 jani Exp $ */ +#include <zend_operators.h> #include <zend_strtod.h> #ifdef ZTS