Skip to content

Commit 86c1a26

Browse files
committed
Merge fix of #62836 to ?.re, and regenerate ?.c
1 parent 9e7c2e5 commit 86c1a26

File tree

2 files changed

+37
-31
lines changed

2 files changed

+37
-31
lines changed

ext/standard/var_unserializer.c

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Generated by re2c 0.13.5 on Wed Nov 9 19:37:48 2011 */
1+
/* Generated by re2c 0.13.5 on Mon Jan 21 11:34:03 2013 */
22
#line 1 "ext/standard/var_unserializer.re"
33
/*
44
+----------------------------------------------------------------------+
@@ -427,7 +427,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
427427

428428

429429

430-
#line 425 "ext/standard/var_unserializer.c"
430+
#line 431 "ext/standard/var_unserializer.c"
431431
{
432432
YYCTYPE yych;
433433
static const unsigned char yybm[] = {
@@ -487,9 +487,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
487487
yych = *(YYMARKER = ++YYCURSOR);
488488
if (yych == ':') goto yy95;
489489
yy3:
490-
#line 747 "ext/standard/var_unserializer.re"
490+
#line 759 "ext/standard/var_unserializer.re"
491491
{ return 0; }
492-
#line 487 "ext/standard/var_unserializer.c"
492+
#line 493 "ext/standard/var_unserializer.c"
493493
yy4:
494494
yych = *(YYMARKER = ++YYCURSOR);
495495
if (yych == ':') goto yy89;
@@ -532,13 +532,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
532532
goto yy3;
533533
yy14:
534534
++YYCURSOR;
535-
#line 741 "ext/standard/var_unserializer.re"
535+
#line 753 "ext/standard/var_unserializer.re"
536536
{
537537
/* this is the case where we have less data than planned */
538538
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unexpected end of serialized data");
539539
return 0; /* not sure if it should be 0 or 1 here? */
540540
}
541-
#line 536 "ext/standard/var_unserializer.c"
541+
#line 542 "ext/standard/var_unserializer.c"
542542
yy16:
543543
yych = *++YYCURSOR;
544544
goto yy3;
@@ -568,7 +568,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
568568
yych = *++YYCURSOR;
569569
if (yych != '"') goto yy18;
570570
++YYCURSOR;
571-
#line 624 "ext/standard/var_unserializer.re"
571+
#line 630 "ext/standard/var_unserializer.re"
572572
{
573573
size_t len, len2, len3, maxlen;
574574
long elements;
@@ -691,7 +691,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
691691

692692
return object_common2(UNSERIALIZE_PASSTHRU, elements);
693693
}
694-
#line 683 "ext/standard/var_unserializer.c"
694+
#line 695 "ext/standard/var_unserializer.c"
695695
yy25:
696696
yych = *++YYCURSOR;
697697
if (yych <= ',') {
@@ -716,15 +716,15 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
716716
yych = *++YYCURSOR;
717717
if (yych != '"') goto yy18;
718718
++YYCURSOR;
719-
#line 616 "ext/standard/var_unserializer.re"
719+
#line 622 "ext/standard/var_unserializer.re"
720720
{
721721

722722
INIT_PZVAL(*rval);
723723

724724
return object_common2(UNSERIALIZE_PASSTHRU,
725725
object_common1(UNSERIALIZE_PASSTHRU, ZEND_STANDARD_CLASS_DEF_PTR));
726726
}
727-
#line 716 "ext/standard/var_unserializer.c"
727+
#line 728 "ext/standard/var_unserializer.c"
728728
yy32:
729729
yych = *++YYCURSOR;
730730
if (yych == '+') goto yy33;
@@ -745,7 +745,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
745745
yych = *++YYCURSOR;
746746
if (yych != '{') goto yy18;
747747
++YYCURSOR;
748-
#line 596 "ext/standard/var_unserializer.re"
748+
#line 602 "ext/standard/var_unserializer.re"
749749
{
750750
long elements = parse_iv(start + 2);
751751
/* use iv() not uiv() in order to check data range */
@@ -765,7 +765,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
765765

766766
return finish_nested_data(UNSERIALIZE_PASSTHRU);
767767
}
768-
#line 757 "ext/standard/var_unserializer.c"
768+
#line 769 "ext/standard/var_unserializer.c"
769769
yy39:
770770
yych = *++YYCURSOR;
771771
if (yych == '+') goto yy40;
@@ -786,7 +786,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
786786
yych = *++YYCURSOR;
787787
if (yych != '"') goto yy18;
788788
++YYCURSOR;
789-
#line 567 "ext/standard/var_unserializer.re"
789+
#line 573 "ext/standard/var_unserializer.re"
790790
{
791791
size_t len, maxlen;
792792
char *str;
@@ -815,7 +815,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
815815
ZVAL_STRINGL(*rval, str, len, 0);
816816
return 1;
817817
}
818-
#line 807 "ext/standard/var_unserializer.c"
818+
#line 819 "ext/standard/var_unserializer.c"
819819
yy46:
820820
yych = *++YYCURSOR;
821821
if (yych == '+') goto yy47;
@@ -836,7 +836,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
836836
yych = *++YYCURSOR;
837837
if (yych != '"') goto yy18;
838838
++YYCURSOR;
839-
#line 539 "ext/standard/var_unserializer.re"
839+
#line 545 "ext/standard/var_unserializer.re"
840840
{
841841
size_t len, maxlen;
842842
char *str;
@@ -864,7 +864,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
864864
ZVAL_STRINGL(*rval, str, len, 1);
865865
return 1;
866866
}
867-
#line 856 "ext/standard/var_unserializer.c"
867+
#line 868 "ext/standard/var_unserializer.c"
868868
yy53:
869869
yych = *++YYCURSOR;
870870
if (yych <= '/') {
@@ -952,7 +952,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
952952
}
953953
yy63:
954954
++YYCURSOR;
955-
#line 529 "ext/standard/var_unserializer.re"
955+
#line 535 "ext/standard/var_unserializer.re"
956956
{
957957
#if SIZEOF_LONG == 4
958958
use_double:
@@ -962,7 +962,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
962962
ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
963963
return 1;
964964
}
965-
#line 954 "ext/standard/var_unserializer.c"
965+
#line 966 "ext/standard/var_unserializer.c"
966966
yy65:
967967
yych = *++YYCURSOR;
968968
if (yych <= ',') {
@@ -1021,7 +1021,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
10211021
yych = *++YYCURSOR;
10221022
if (yych != ';') goto yy18;
10231023
++YYCURSOR;
1024-
#line 514 "ext/standard/var_unserializer.re"
1024+
#line 520 "ext/standard/var_unserializer.re"
10251025
{
10261026
*p = YYCURSOR;
10271027
INIT_PZVAL(*rval);
@@ -1036,7 +1036,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
10361036

10371037
return 1;
10381038
}
1039-
#line 1028 "ext/standard/var_unserializer.c"
1039+
#line 1040 "ext/standard/var_unserializer.c"
10401040
yy76:
10411041
yych = *++YYCURSOR;
10421042
if (yych == 'N') goto yy73;
@@ -1063,7 +1063,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
10631063
if (yych <= '9') goto yy79;
10641064
if (yych != ';') goto yy18;
10651065
++YYCURSOR;
1066-
#line 487 "ext/standard/var_unserializer.re"
1066+
#line 493 "ext/standard/var_unserializer.re"
10671067
{
10681068
#if SIZEOF_LONG == 4
10691069
int digits = YYCURSOR - start - 3;
@@ -1090,32 +1090,32 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
10901090
ZVAL_LONG(*rval, parse_iv(start + 2));
10911091
return 1;
10921092
}
1093-
#line 1082 "ext/standard/var_unserializer.c"
1093+
#line 1094 "ext/standard/var_unserializer.c"
10941094
yy83:
10951095
yych = *++YYCURSOR;
10961096
if (yych <= '/') goto yy18;
10971097
if (yych >= '2') goto yy18;
10981098
yych = *++YYCURSOR;
10991099
if (yych != ';') goto yy18;
11001100
++YYCURSOR;
1101-
#line 480 "ext/standard/var_unserializer.re"
1101+
#line 486 "ext/standard/var_unserializer.re"
11021102
{
11031103
*p = YYCURSOR;
11041104
INIT_PZVAL(*rval);
11051105
ZVAL_BOOL(*rval, parse_iv(start + 2));
11061106
return 1;
11071107
}
1108-
#line 1097 "ext/standard/var_unserializer.c"
1108+
#line 1109 "ext/standard/var_unserializer.c"
11091109
yy87:
11101110
++YYCURSOR;
1111-
#line 473 "ext/standard/var_unserializer.re"
1111+
#line 479 "ext/standard/var_unserializer.re"
11121112
{
11131113
*p = YYCURSOR;
11141114
INIT_PZVAL(*rval);
11151115
ZVAL_NULL(*rval);
11161116
return 1;
11171117
}
1118-
#line 1107 "ext/standard/var_unserializer.c"
1118+
#line 1119 "ext/standard/var_unserializer.c"
11191119
yy89:
11201120
yych = *++YYCURSOR;
11211121
if (yych <= ',') {
@@ -1138,7 +1138,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
11381138
if (yych <= '9') goto yy91;
11391139
if (yych != ';') goto yy18;
11401140
++YYCURSOR;
1141-
#line 450 "ext/standard/var_unserializer.re"
1141+
#line 456 "ext/standard/var_unserializer.re"
11421142
{
11431143
long id;
11441144

@@ -1161,7 +1161,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
11611161

11621162
return 1;
11631163
}
1164-
#line 1153 "ext/standard/var_unserializer.c"
1164+
#line 1165 "ext/standard/var_unserializer.c"
11651165
yy95:
11661166
yych = *++YYCURSOR;
11671167
if (yych <= ',') {
@@ -1184,7 +1184,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
11841184
if (yych <= '9') goto yy97;
11851185
if (yych != ';') goto yy18;
11861186
++YYCURSOR;
1187-
#line 429 "ext/standard/var_unserializer.re"
1187+
#line 435 "ext/standard/var_unserializer.re"
11881188
{
11891189
long id;
11901190

@@ -1205,9 +1205,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
12051205

12061206
return 1;
12071207
}
1208-
#line 1197 "ext/standard/var_unserializer.c"
1208+
#line 1209 "ext/standard/var_unserializer.c"
12091209
}
1210-
#line 749 "ext/standard/var_unserializer.re"
1210+
#line 761 "ext/standard/var_unserializer.re"
12111211

12121212

12131213
return 0;

ext/standard/var_unserializer.re

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,10 +678,13 @@ object ":" uiv ":" ["] {
678678
679679
do {
680680
/* Try to find class directly */
681+
BG(serialize_lock) = 1;
681682
if (zend_lookup_class(class_name, len2, &pce TSRMLS_CC) == SUCCESS) {
683+
BG(serialize_lock) = 0;
682684
ce = *pce;
683685
break;
684686
}
687+
BG(serialize_lock) = 0;
685688
686689
/* Check for unserialize callback */
687690
if ((PG(unserialize_callback_func) == NULL) || (PG(unserialize_callback_func)[0] == '\0')) {
@@ -696,14 +699,17 @@ object ":" uiv ":" ["] {
696699
args[0] = &arg_func_name;
697700
MAKE_STD_ZVAL(arg_func_name);
698701
ZVAL_STRING(arg_func_name, class_name, 1);
702+
BG(serialize_lock) = 1;
699703
if (call_user_function_ex(CG(function_table), NULL, user_func, &retval_ptr, 1, args, 0, NULL TSRMLS_CC) != SUCCESS) {
704+
BG(serialize_lock) = 0;
700705
php_error_docref(NULL TSRMLS_CC, E_WARNING, "defined (%s) but not found", user_func->value.str.val);
701706
incomplete_class = 1;
702707
ce = PHP_IC_ENTRY;
703708
zval_ptr_dtor(&user_func);
704709
zval_ptr_dtor(&arg_func_name);
705710
break;
706711
}
712+
BG(serialize_lock) = 0;
707713
if (retval_ptr) {
708714
zval_ptr_dtor(&retval_ptr);
709715
}

0 commit comments

Comments
 (0)