mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Fixed bug #31699 (unserialize() float problem on non-English locales).
This commit is contained in:
parent
51ca0e7bbb
commit
4a5294788e
@ -1,5 +1,5 @@
|
|||||||
/* Generated by re2c 0.9.4 on Mon Sep 13 22:00:00 2004 */
|
/* Generated by re2c 0.9.3 on Wed Jan 26 11:09:50 2005 */
|
||||||
#line 1 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 1 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
/*
|
/*
|
||||||
+----------------------------------------------------------------------+
|
+----------------------------------------------------------------------+
|
||||||
| PHP Version 5 |
|
| PHP Version 5 |
|
||||||
@ -125,7 +125,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
|
|||||||
efree(var_hash);
|
efree(var_hash);
|
||||||
var_hash = next;
|
var_hash = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
var_hash = var_hashx->first_dtor;
|
var_hash = var_hashx->first_dtor;
|
||||||
|
|
||||||
while (var_hash) {
|
while (var_hash) {
|
||||||
@ -147,7 +147,7 @@ PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
|
|||||||
#define YYMARKER marker
|
#define YYMARKER marker
|
||||||
|
|
||||||
|
|
||||||
#line 118 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 154 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -406,7 +406,7 @@ yy0:
|
|||||||
goto yy16;
|
goto yy16;
|
||||||
} else {
|
} else {
|
||||||
if(yych <= '}') goto yy14;
|
if(yych <= '}') goto yy14;
|
||||||
if(yych <= 0xBF) goto yy16;
|
if(yych <= '\277') goto yy16;
|
||||||
goto yy2;
|
goto yy2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +420,7 @@ yy3: yyaccept = 0;
|
|||||||
if(yych == ':') goto yy87;
|
if(yych == ':') goto yy87;
|
||||||
goto yy4;
|
goto yy4;
|
||||||
yy4:
|
yy4:
|
||||||
#line 532 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 576 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{ return 0; }
|
{ return 0; }
|
||||||
#line 102 "<stdout>"
|
#line 102 "<stdout>"
|
||||||
yy5: yyaccept = 0;
|
yy5: yyaccept = 0;
|
||||||
@ -461,7 +461,7 @@ yy13: yyaccept = 0;
|
|||||||
yy14: ++YYCURSOR;
|
yy14: ++YYCURSOR;
|
||||||
goto yy15;
|
goto yy15;
|
||||||
yy15:
|
yy15:
|
||||||
#line 526 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 570 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
/* this is the case where we have less data than planned */
|
/* this is the case where we have less data than planned */
|
||||||
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
|
||||||
@ -490,7 +490,7 @@ yy21: yych = *++YYCURSOR;
|
|||||||
yy22: ++YYCURSOR;
|
yy22: ++YYCURSOR;
|
||||||
goto yy23;
|
goto yy23;
|
||||||
yy23:
|
yy23:
|
||||||
#line 433 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 477 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
size_t len, len2, maxlen;
|
size_t len, len2, maxlen;
|
||||||
int elements;
|
int elements;
|
||||||
@ -612,7 +612,7 @@ yy28: yych = *++YYCURSOR;
|
|||||||
yy29: ++YYCURSOR;
|
yy29: ++YYCURSOR;
|
||||||
goto yy30;
|
goto yy30;
|
||||||
yy30:
|
yy30:
|
||||||
#line 425 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 469 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
|
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
@ -644,7 +644,7 @@ yy35: yych = *++YYCURSOR;
|
|||||||
yy36: ++YYCURSOR;
|
yy36: ++YYCURSOR;
|
||||||
goto yy37;
|
goto yy37;
|
||||||
yy37:
|
yy37:
|
||||||
#line 407 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 451 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
int elements = parse_iv(start + 2);
|
int elements = parse_iv(start + 2);
|
||||||
|
|
||||||
@ -686,7 +686,7 @@ yy42: yych = *++YYCURSOR;
|
|||||||
yy43: ++YYCURSOR;
|
yy43: ++YYCURSOR;
|
||||||
goto yy44;
|
goto yy44;
|
||||||
yy44:
|
yy44:
|
||||||
#line 379 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 423 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
size_t len, maxlen;
|
size_t len, maxlen;
|
||||||
char *str;
|
char *str;
|
||||||
@ -803,11 +803,11 @@ yy54: if(yych <= ';'){
|
|||||||
yy55: ++YYCURSOR;
|
yy55: ++YYCURSOR;
|
||||||
goto yy56;
|
goto yy56;
|
||||||
yy56:
|
yy56:
|
||||||
#line 372 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 416 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
ZVAL_DOUBLE(*rval, atof(start + 2));
|
ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#line 496 "<stdout>"
|
#line 496 "<stdout>"
|
||||||
@ -870,12 +870,12 @@ yy65: yych = *++YYCURSOR;
|
|||||||
yy66: ++YYCURSOR;
|
yy66: ++YYCURSOR;
|
||||||
goto yy67;
|
goto yy67;
|
||||||
yy67:
|
yy67:
|
||||||
#line 355 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 399 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
#if defined(HAVE_ATOF_ACCEPTS_NAN) && defined(HAVE_ATOF_ACCEPTS_INF)
|
#if defined(HAVE_ATOF_ACCEPTS_NAN) && defined(HAVE_ATOF_ACCEPTS_INF)
|
||||||
ZVAL_DOUBLE(*rval, atof(start + 2));
|
ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
|
||||||
#else
|
#else
|
||||||
if (!strncmp(start + 2, "NAN", 3)) {
|
if (!strncmp(start + 2, "NAN", 3)) {
|
||||||
ZVAL_DOUBLE(*rval, php_get_nan());
|
ZVAL_DOUBLE(*rval, php_get_nan());
|
||||||
@ -916,7 +916,7 @@ yy72: if(yych <= '/') goto yy2;
|
|||||||
yy73: ++YYCURSOR;
|
yy73: ++YYCURSOR;
|
||||||
goto yy74;
|
goto yy74;
|
||||||
yy74:
|
yy74:
|
||||||
#line 348 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 392 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
@ -934,7 +934,7 @@ yy76: yych = *++YYCURSOR;
|
|||||||
yy77: ++YYCURSOR;
|
yy77: ++YYCURSOR;
|
||||||
goto yy78;
|
goto yy78;
|
||||||
yy78:
|
yy78:
|
||||||
#line 341 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 385 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
@ -945,7 +945,7 @@ yy78:
|
|||||||
yy79: ++YYCURSOR;
|
yy79: ++YYCURSOR;
|
||||||
goto yy80;
|
goto yy80;
|
||||||
yy80:
|
yy80:
|
||||||
#line 334 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 378 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
@ -978,7 +978,7 @@ yy84: if(yych <= '/') goto yy2;
|
|||||||
yy85: ++YYCURSOR;
|
yy85: ++YYCURSOR;
|
||||||
goto yy86;
|
goto yy86;
|
||||||
yy86:
|
yy86:
|
||||||
#line 313 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 355 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
@ -989,7 +989,7 @@ yy86:
|
|||||||
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
|
if (id == -1 || var_access(var_hash, id, &rval_ref) != SUCCESS) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*rval == *rval_ref) return 0;
|
if (*rval == *rval_ref) return 0;
|
||||||
|
|
||||||
if (*rval != NULL) {
|
if (*rval != NULL) {
|
||||||
@ -1001,7 +1001,7 @@ yy86:
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#line 689 "<stdout>"
|
#line 691 "<stdout>"
|
||||||
yy87: yych = *++YYCURSOR;
|
yy87: yych = *++YYCURSOR;
|
||||||
if(yych <= ','){
|
if(yych <= ','){
|
||||||
if(yych != '+') goto yy2;
|
if(yych != '+') goto yy2;
|
||||||
@ -1027,7 +1027,7 @@ yy90: if(yych <= '/') goto yy2;
|
|||||||
yy91: ++YYCURSOR;
|
yy91: ++YYCURSOR;
|
||||||
goto yy92;
|
goto yy92;
|
||||||
yy92:
|
yy92:
|
||||||
#line 292 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 334 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
{
|
{
|
||||||
int id;
|
int id;
|
||||||
|
|
||||||
@ -1048,9 +1048,9 @@ yy92:
|
|||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
#line 737 "<stdout>"
|
#line 739 "<stdout>"
|
||||||
}
|
}
|
||||||
#line 534 "/usr/src/php-cvs/ext/standard/var_unserializer.re"
|
#line 578 "/home/rei/php_dev/php5.1/ext/standard/var_unserializer.re"
|
||||||
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -400,7 +400,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
|||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
#if defined(HAVE_ATOF_ACCEPTS_NAN) && defined(HAVE_ATOF_ACCEPTS_INF)
|
#if defined(HAVE_ATOF_ACCEPTS_NAN) && defined(HAVE_ATOF_ACCEPTS_INF)
|
||||||
ZVAL_DOUBLE(*rval, atof(start + 2));
|
ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
|
||||||
#else
|
#else
|
||||||
if (!strncmp(start + 2, "NAN", 3)) {
|
if (!strncmp(start + 2, "NAN", 3)) {
|
||||||
ZVAL_DOUBLE(*rval, php_get_nan());
|
ZVAL_DOUBLE(*rval, php_get_nan());
|
||||||
@ -416,7 +416,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
|
|||||||
"d:" (iv | nv | nvexp) ";" {
|
"d:" (iv | nv | nvexp) ";" {
|
||||||
*p = YYCURSOR;
|
*p = YYCURSOR;
|
||||||
INIT_PZVAL(*rval);
|
INIT_PZVAL(*rval);
|
||||||
ZVAL_DOUBLE(*rval, atof(start + 2));
|
ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user