Skip to content
Browse files

Merge branch 'PHP-5.4' into PHP-5.5

Conflicts:
	ext/standard/var_unserializer.c
  • Loading branch information...
2 parents f7b99c4 + 86c1a26 commit 85fae636d09a08b53ffd7244cc6e8ec4d4cdab7c @laruence laruence committed Jan 21, 2013
Showing with 37 additions and 31 deletions.
  1. +31 −31 ext/standard/var_unserializer.c
  2. +6 −0 ext/standard/var_unserializer.re
View
62 ext/standard/var_unserializer.c
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 */
+/* Generated by re2c 0.13.5 on Mon Jan 21 11:41:53 2013 */
#line 1 "ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
@@ -427,7 +427,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
-#line 425 "ext/standard/var_unserializer.c"
+#line 431 "ext/standard/var_unserializer.c"
{
YYCTYPE yych;
static const unsigned char yybm[] = {
@@ -487,9 +487,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy95;
yy3:
-#line 747 "ext/standard/var_unserializer.re"
+#line 759 "ext/standard/var_unserializer.re"
{ return 0; }
-#line 487 "ext/standard/var_unserializer.c"
+#line 493 "ext/standard/var_unserializer.c"
yy4:
yych = *(YYMARKER = ++YYCURSOR);
if (yych == ':') goto yy89;
@@ -532,13 +532,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
goto yy3;
yy14:
++YYCURSOR;
-#line 741 "ext/standard/var_unserializer.re"
+#line 753 "ext/standard/var_unserializer.re"
{
/* this is the case where we have less data than planned */
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
return 0; /* not sure if it should be 0 or 1 here? */
}
-#line 536 "ext/standard/var_unserializer.c"
+#line 542 "ext/standard/var_unserializer.c"
yy16:
yych = *++YYCURSOR;
goto yy3;
@@ -568,7 +568,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 624 "ext/standard/var_unserializer.re"
+#line 630 "ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
long elements;
@@ -691,7 +691,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return object_common2(UNSERIALIZE_PASSTHRU, elements);
}
-#line 683 "ext/standard/var_unserializer.c"
+#line 695 "ext/standard/var_unserializer.c"
yy25:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -716,15 +716,15 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 616 "ext/standard/var_unserializer.re"
+#line 622 "ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
return object_common2(UNSERIALIZE_PASSTHRU,
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
}
-#line 716 "ext/standard/var_unserializer.c"
+#line 728 "ext/standard/var_unserializer.c"
yy32:
yych = *++YYCURSOR;
if (yych == '+') goto yy33;
@@ -745,7 +745,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != '{') goto yy18;
++YYCURSOR;
-#line 596 "ext/standard/var_unserializer.re"
+#line 602 "ext/standard/var_unserializer.re"
{
long elements = parse_iv(start + 2);
/* use iv() not uiv() in order to check data range */
@@ -765,7 +765,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 757 "ext/standard/var_unserializer.c"
+#line 769 "ext/standard/var_unserializer.c"
yy39:
yych = *++YYCURSOR;
if (yych == '+') goto yy40;
@@ -786,7 +786,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 567 "ext/standard/var_unserializer.re"
+#line 573 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -815,7 +815,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
ZVAL_STRINGL(*rval, str, len, 0);
return 1;
}
-#line 807 "ext/standard/var_unserializer.c"
+#line 819 "ext/standard/var_unserializer.c"
yy46:
yych = *++YYCURSOR;
if (yych == '+') goto yy47;
@@ -836,7 +836,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != '"') goto yy18;
++YYCURSOR;
-#line 539 "ext/standard/var_unserializer.re"
+#line 545 "ext/standard/var_unserializer.re"
{
size_t len, maxlen;
char *str;
@@ -864,7 +864,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 856 "ext/standard/var_unserializer.c"
+#line 868 "ext/standard/var_unserializer.c"
yy53:
yych = *++YYCURSOR;
if (yych <= '/') {
@@ -952,7 +952,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
}
yy63:
++YYCURSOR;
-#line 529 "ext/standard/var_unserializer.re"
+#line 535 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
use_double:
@@ -962,7 +962,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 954 "ext/standard/var_unserializer.c"
+#line 966 "ext/standard/var_unserializer.c"
yy65:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1021,7 +1021,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 514 "ext/standard/var_unserializer.re"
+#line 520 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
@@ -1036,7 +1036,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1028 "ext/standard/var_unserializer.c"
+#line 1040 "ext/standard/var_unserializer.c"
yy76:
yych = *++YYCURSOR;
if (yych == 'N') goto yy73;
@@ -1063,7 +1063,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (yych <= '9') goto yy79;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 487 "ext/standard/var_unserializer.re"
+#line 493 "ext/standard/var_unserializer.re"
{
#if SIZEOF_LONG == 4
int digits = YYCURSOR - start - 3;
@@ -1090,32 +1090,32 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
-#line 1082 "ext/standard/var_unserializer.c"
+#line 1094 "ext/standard/var_unserializer.c"
yy83:
yych = *++YYCURSOR;
if (yych <= '/') goto yy18;
if (yych >= '2') goto yy18;
yych = *++YYCURSOR;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 480 "ext/standard/var_unserializer.re"
+#line 486 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 1097 "ext/standard/var_unserializer.c"
+#line 1109 "ext/standard/var_unserializer.c"
yy87:
++YYCURSOR;
-#line 473 "ext/standard/var_unserializer.re"
+#line 479 "ext/standard/var_unserializer.re"
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
ZVAL_NULL(*rval);
return 1;
}
-#line 1107 "ext/standard/var_unserializer.c"
+#line 1119 "ext/standard/var_unserializer.c"
yy89:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1138,7 +1138,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (yych <= '9') goto yy91;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 450 "ext/standard/var_unserializer.re"
+#line 456 "ext/standard/var_unserializer.re"
{
long id;
@@ -1161,7 +1161,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1153 "ext/standard/var_unserializer.c"
+#line 1165 "ext/standard/var_unserializer.c"
yy95:
yych = *++YYCURSOR;
if (yych <= ',') {
@@ -1184,7 +1184,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
if (yych <= '9') goto yy97;
if (yych != ';') goto yy18;
++YYCURSOR;
-#line 429 "ext/standard/var_unserializer.re"
+#line 435 "ext/standard/var_unserializer.re"
{
long id;
@@ -1205,9 +1205,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
return 1;
}
-#line 1197 "ext/standard/var_unserializer.c"
+#line 1209 "ext/standard/var_unserializer.c"
}
-#line 749 "ext/standard/var_unserializer.re"
+#line 761 "ext/standard/var_unserializer.re"
return 0;
View
6 ext/standard/var_unserializer.re
@@ -678,10 +678,13 @@ object ":" uiv ":" ["] {
do {
/* Try to find class directly */
+ BG(serialize_lock) = 1;
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
+ BG(serialize_lock) = 0;
ce = *pce;
break;
}
+ BG(serialize_lock) = 0;
/* Check for unserialize callback */
if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) {
@@ -696,14 +699,17 @@ object ":" uiv ":" ["] {
args[0] = &arg_func_name;
MAKE_STD_ZVAL(arg_func_name);
ZVAL_STRING(arg_func_name, class_name, 1);
+ BG(serialize_lock) = 1;
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
+ BG(serialize_lock) = 0;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
incomplete_class = 1;
ce = PHP_IC_ENTRY;
zval_ptr_dtor(&user_func);
zval_ptr_dtor(&arg_func_name);
break;
}
+ BG(serialize_lock) = 0;
if (retval_ptr) {
zval_ptr_dtor(&retval_ptr);
}

0 comments on commit 85fae63

Please sign in to comment.
Something went wrong with that request. Please try again.