1
- /* Generated by re2c 0.13.5 on Thu Apr 17 10:03:26 2014 */
1
+ /* Generated by re2c 0.13.5 on Fri Apr 18 15:07:27 2014 */
2
2
#line 1 "ext/standard/var_unserializer.re"
3
3
/*
4
4
+----------------------------------------------------------------------+
@@ -396,9 +396,12 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
396
396
397
397
(* p ) += 2 ;
398
398
399
- if (ce -> unserialize == NULL ) {
399
+ if (ce -> serialize == NULL ) {
400
400
object_init_ex (* rval , ce );
401
- } else if (ce -> unserialize (rval , ce , (const unsigned char * )* p , elements , (zend_unserialize_data * )var_hash TSRMLS_CC ) != SUCCESS ) {
401
+ } else {
402
+ /* If this class implements Serializable, it should not land here but in object_custom(). The passed string
403
+ obviously doesn't descend from the regular serializer. */
404
+ zend_error (E_WARNING , "Erroneous data format for unserializing '%s'" , ce -> name );
402
405
return 0 ;
403
406
}
404
407
@@ -466,7 +469,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
466
469
467
470
468
471
469
- #line 470 "ext/standard/var_unserializer.c"
472
+ #line 473 "ext/standard/var_unserializer.c"
470
473
{
471
474
YYCTYPE yych ;
472
475
static const unsigned char yybm [] = {
@@ -526,9 +529,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
526
529
yych = * (YYMARKER = ++ YYCURSOR );
527
530
if (yych == ':' ) goto yy95 ;
528
531
yy3 :
529
- #line 821 "ext/standard/var_unserializer.re"
532
+ #line 824 "ext/standard/var_unserializer.re"
530
533
{ return 0 ; }
531
- #line 532 "ext/standard/var_unserializer.c"
534
+ #line 535 "ext/standard/var_unserializer.c"
532
535
yy4 :
533
536
yych = * (YYMARKER = ++ YYCURSOR );
534
537
if (yych == ':' ) goto yy89 ;
@@ -571,13 +574,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
571
574
goto yy3 ;
572
575
yy14 :
573
576
++ YYCURSOR ;
574
- #line 815 "ext/standard/var_unserializer.re"
577
+ #line 818 "ext/standard/var_unserializer.re"
575
578
{
576
579
/* this is the case where we have less data than planned */
577
580
php_error_docref (NULL TSRMLS_CC , E_NOTICE , "Unexpected end of serialized data" );
578
581
return 0 ; /* not sure if it should be 0 or 1 here? */
579
582
}
580
- #line 581 "ext/standard/var_unserializer.c"
583
+ #line 584 "ext/standard/var_unserializer.c"
581
584
yy16 :
582
585
yych = * ++ YYCURSOR ;
583
586
goto yy3 ;
@@ -607,7 +610,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
607
610
yych = * ++ YYCURSOR ;
608
611
if (yych != '"' ) goto yy18 ;
609
612
++ YYCURSOR ;
610
- #line 669 "ext/standard/var_unserializer.re"
613
+ #line 672 "ext/standard/var_unserializer.re"
611
614
{
612
615
size_t len , len2 , len3 , maxlen ;
613
616
long elements ;
@@ -753,7 +756,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
753
756
754
757
return object_common2 (UNSERIALIZE_PASSTHRU , elements );
755
758
}
756
- #line 757 "ext/standard/var_unserializer.c"
759
+ #line 760 "ext/standard/var_unserializer.c"
757
760
yy25 :
758
761
yych = * ++ YYCURSOR ;
759
762
if (yych <= ',' ) {
@@ -778,15 +781,15 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
778
781
yych = * ++ YYCURSOR ;
779
782
if (yych != '"' ) goto yy18 ;
780
783
++ YYCURSOR ;
781
- #line 661 "ext/standard/var_unserializer.re"
784
+ #line 664 "ext/standard/var_unserializer.re"
782
785
{
783
786
784
787
INIT_PZVAL (* rval );
785
788
786
789
return object_common2 (UNSERIALIZE_PASSTHRU ,
787
790
object_common1 (UNSERIALIZE_PASSTHRU , ZEND_STANDARD_CLASS_DEF_PTR ));
788
791
}
789
- #line 790 "ext/standard/var_unserializer.c"
792
+ #line 793 "ext/standard/var_unserializer.c"
790
793
yy32 :
791
794
yych = * ++ YYCURSOR ;
792
795
if (yych == '+' ) goto yy33 ;
@@ -807,7 +810,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
807
810
yych = * ++ YYCURSOR ;
808
811
if (yych != '{' ) goto yy18 ;
809
812
++ YYCURSOR ;
810
- #line 641 "ext/standard/var_unserializer.re"
813
+ #line 644 "ext/standard/var_unserializer.re"
811
814
{
812
815
long elements = parse_iv (start + 2 );
813
816
/* use iv() not uiv() in order to check data range */
@@ -827,7 +830,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
827
830
828
831
return finish_nested_data (UNSERIALIZE_PASSTHRU );
829
832
}
830
- #line 831 "ext/standard/var_unserializer.c"
833
+ #line 834 "ext/standard/var_unserializer.c"
831
834
yy39 :
832
835
yych = * ++ YYCURSOR ;
833
836
if (yych == '+' ) goto yy40 ;
@@ -848,7 +851,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
848
851
yych = * ++ YYCURSOR ;
849
852
if (yych != '"' ) goto yy18 ;
850
853
++ YYCURSOR ;
851
- #line 612 "ext/standard/var_unserializer.re"
854
+ #line 615 "ext/standard/var_unserializer.re"
852
855
{
853
856
size_t len , maxlen ;
854
857
char * str ;
@@ -877,7 +880,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
877
880
ZVAL_STRINGL (* rval , str , len , 0 );
878
881
return 1 ;
879
882
}
880
- #line 881 "ext/standard/var_unserializer.c"
883
+ #line 884 "ext/standard/var_unserializer.c"
881
884
yy46 :
882
885
yych = * ++ YYCURSOR ;
883
886
if (yych == '+' ) goto yy47 ;
@@ -898,7 +901,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
898
901
yych = * ++ YYCURSOR ;
899
902
if (yych != '"' ) goto yy18 ;
900
903
++ YYCURSOR ;
901
- #line 584 "ext/standard/var_unserializer.re"
904
+ #line 587 "ext/standard/var_unserializer.re"
902
905
{
903
906
size_t len , maxlen ;
904
907
char * str ;
@@ -926,7 +929,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
926
929
ZVAL_STRINGL (* rval , str , len , 1 );
927
930
return 1 ;
928
931
}
929
- #line 930 "ext/standard/var_unserializer.c"
932
+ #line 933 "ext/standard/var_unserializer.c"
930
933
yy53 :
931
934
yych = * ++ YYCURSOR ;
932
935
if (yych <= '/' ) {
@@ -1014,7 +1017,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1014
1017
}
1015
1018
yy63 :
1016
1019
++ YYCURSOR ;
1017
- #line 574 "ext/standard/var_unserializer.re"
1020
+ #line 577 "ext/standard/var_unserializer.re"
1018
1021
{
1019
1022
#if SIZEOF_LONG == 4
1020
1023
use_double :
@@ -1024,7 +1027,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1024
1027
ZVAL_DOUBLE (* rval , zend_strtod ((const char * )start + 2 , NULL ));
1025
1028
return 1 ;
1026
1029
}
1027
- #line 1028 "ext/standard/var_unserializer.c"
1030
+ #line 1031 "ext/standard/var_unserializer.c"
1028
1031
yy65 :
1029
1032
yych = * ++ YYCURSOR ;
1030
1033
if (yych <= ',' ) {
@@ -1083,7 +1086,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1083
1086
yych = * ++ YYCURSOR ;
1084
1087
if (yych != ';' ) goto yy18 ;
1085
1088
++ YYCURSOR ;
1086
- #line 559 "ext/standard/var_unserializer.re"
1089
+ #line 562 "ext/standard/var_unserializer.re"
1087
1090
{
1088
1091
* p = YYCURSOR ;
1089
1092
INIT_PZVAL (* rval );
@@ -1098,7 +1101,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1098
1101
1099
1102
return 1 ;
1100
1103
}
1101
- #line 1102 "ext/standard/var_unserializer.c"
1104
+ #line 1105 "ext/standard/var_unserializer.c"
1102
1105
yy76 :
1103
1106
yych = * ++ YYCURSOR ;
1104
1107
if (yych == 'N' ) goto yy73 ;
@@ -1125,7 +1128,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1125
1128
if (yych <= '9' ) goto yy79 ;
1126
1129
if (yych != ';' ) goto yy18 ;
1127
1130
++ YYCURSOR ;
1128
- #line 532 "ext/standard/var_unserializer.re"
1131
+ #line 535 "ext/standard/var_unserializer.re"
1129
1132
{
1130
1133
#if SIZEOF_LONG == 4
1131
1134
int digits = YYCURSOR - start - 3 ;
@@ -1152,32 +1155,32 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1152
1155
ZVAL_LONG (* rval , parse_iv (start + 2 ));
1153
1156
return 1 ;
1154
1157
}
1155
- #line 1156 "ext/standard/var_unserializer.c"
1158
+ #line 1159 "ext/standard/var_unserializer.c"
1156
1159
yy83 :
1157
1160
yych = * ++ YYCURSOR ;
1158
1161
if (yych <= '/' ) goto yy18 ;
1159
1162
if (yych >= '2' ) goto yy18 ;
1160
1163
yych = * ++ YYCURSOR ;
1161
1164
if (yych != ';' ) goto yy18 ;
1162
1165
++ YYCURSOR ;
1163
- #line 525 "ext/standard/var_unserializer.re"
1166
+ #line 528 "ext/standard/var_unserializer.re"
1164
1167
{
1165
1168
* p = YYCURSOR ;
1166
1169
INIT_PZVAL (* rval );
1167
1170
ZVAL_BOOL (* rval , parse_iv (start + 2 ));
1168
1171
return 1 ;
1169
1172
}
1170
- #line 1171 "ext/standard/var_unserializer.c"
1173
+ #line 1174 "ext/standard/var_unserializer.c"
1171
1174
yy87 :
1172
1175
++ YYCURSOR ;
1173
- #line 518 "ext/standard/var_unserializer.re"
1176
+ #line 521 "ext/standard/var_unserializer.re"
1174
1177
{
1175
1178
* p = YYCURSOR ;
1176
1179
INIT_PZVAL (* rval );
1177
1180
ZVAL_NULL (* rval );
1178
1181
return 1 ;
1179
1182
}
1180
- #line 1181 "ext/standard/var_unserializer.c"
1183
+ #line 1184 "ext/standard/var_unserializer.c"
1181
1184
yy89 :
1182
1185
yych = * ++ YYCURSOR ;
1183
1186
if (yych <= ',' ) {
@@ -1200,7 +1203,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1200
1203
if (yych <= '9' ) goto yy91 ;
1201
1204
if (yych != ';' ) goto yy18 ;
1202
1205
++ YYCURSOR ;
1203
- #line 495 "ext/standard/var_unserializer.re"
1206
+ #line 498 "ext/standard/var_unserializer.re"
1204
1207
{
1205
1208
long id ;
1206
1209
@@ -1223,7 +1226,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1223
1226
1224
1227
return 1 ;
1225
1228
}
1226
- #line 1227 "ext/standard/var_unserializer.c"
1229
+ #line 1230 "ext/standard/var_unserializer.c"
1227
1230
yy95 :
1228
1231
yych = * ++ YYCURSOR ;
1229
1232
if (yych <= ',' ) {
@@ -1246,7 +1249,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1246
1249
if (yych <= '9' ) goto yy97 ;
1247
1250
if (yych != ';' ) goto yy18 ;
1248
1251
++ YYCURSOR ;
1249
- #line 474 "ext/standard/var_unserializer.re"
1252
+ #line 477 "ext/standard/var_unserializer.re"
1250
1253
{
1251
1254
long id ;
1252
1255
@@ -1267,9 +1270,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1267
1270
1268
1271
return 1 ;
1269
1272
}
1270
- #line 1271 "ext/standard/var_unserializer.c"
1273
+ #line 1274 "ext/standard/var_unserializer.c"
1271
1274
}
1272
- #line 823 "ext/standard/var_unserializer.re"
1275
+ #line 826 "ext/standard/var_unserializer.re"
1273
1276
1274
1277
1275
1278
return 0 ;
0 commit comments