1
- /* Generated by re2c 0.13.5 on Mon Jul 29 17:57 :26 2013 */
1
+ /* Generated by re2c 0.13.5 on Thu Apr 17 10:03 :26 2014 */
2
2
#line 1 "ext/standard/var_unserializer.re"
3
3
/*
4
4
+----------------------------------------------------------------------+
5
5
| PHP Version 5 |
6
6
+----------------------------------------------------------------------+
7
- | Copyright (c) 1997-2014 The PHP Group |
7
+ | Copyright (c) 1997-2013 The PHP Group |
8
8
+----------------------------------------------------------------------+
9
9
| This source file is subject to version 3.01 of the PHP license, |
10
10
| that is bundled with this package in the file LICENSE, and is |
@@ -396,7 +396,12 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
396
396
397
397
(* p ) += 2 ;
398
398
399
- object_init_ex (* rval , ce );
399
+ if (ce -> unserialize == NULL ) {
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 ) {
402
+ return 0 ;
403
+ }
404
+
400
405
return elements ;
401
406
}
402
407
@@ -408,6 +413,10 @@ static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
408
413
zval * retval_ptr = NULL ;
409
414
zval fname ;
410
415
416
+ if (Z_TYPE_PP (rval ) != IS_OBJECT ) {
417
+ return 0 ;
418
+ }
419
+
411
420
if (!process_nested_data (UNSERIALIZE_PASSTHRU , Z_OBJPROP_PP (rval ), elements , 1 )) {
412
421
return 0 ;
413
422
}
@@ -457,7 +466,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
457
466
458
467
459
468
460
- #line 461 "ext/standard/var_unserializer.c"
469
+ #line 470 "ext/standard/var_unserializer.c"
461
470
{
462
471
YYCTYPE yych ;
463
472
static const unsigned char yybm [] = {
@@ -517,9 +526,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
517
526
yych = * (YYMARKER = ++ YYCURSOR );
518
527
if (yych == ':' ) goto yy95 ;
519
528
yy3 :
520
- #line 812 "ext/standard/var_unserializer.re"
529
+ #line 821 "ext/standard/var_unserializer.re"
521
530
{ return 0 ; }
522
- #line 523 "ext/standard/var_unserializer.c"
531
+ #line 532 "ext/standard/var_unserializer.c"
523
532
yy4 :
524
533
yych = * (YYMARKER = ++ YYCURSOR );
525
534
if (yych == ':' ) goto yy89 ;
@@ -562,13 +571,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
562
571
goto yy3 ;
563
572
yy14 :
564
573
++ YYCURSOR ;
565
- #line 806 "ext/standard/var_unserializer.re"
574
+ #line 815 "ext/standard/var_unserializer.re"
566
575
{
567
576
/* this is the case where we have less data than planned */
568
577
php_error_docref (NULL TSRMLS_CC , E_NOTICE , "Unexpected end of serialized data" );
569
578
return 0 ; /* not sure if it should be 0 or 1 here? */
570
579
}
571
- #line 572 "ext/standard/var_unserializer.c"
580
+ #line 581 "ext/standard/var_unserializer.c"
572
581
yy16 :
573
582
yych = * ++ YYCURSOR ;
574
583
goto yy3 ;
@@ -598,7 +607,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
598
607
yych = * ++ YYCURSOR ;
599
608
if (yych != '"' ) goto yy18 ;
600
609
++ YYCURSOR ;
601
- #line 660 "ext/standard/var_unserializer.re"
610
+ #line 669 "ext/standard/var_unserializer.re"
602
611
{
603
612
size_t len , len2 , len3 , maxlen ;
604
613
long elements ;
@@ -744,7 +753,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
744
753
745
754
return object_common2 (UNSERIALIZE_PASSTHRU , elements );
746
755
}
747
- #line 748 "ext/standard/var_unserializer.c"
756
+ #line 757 "ext/standard/var_unserializer.c"
748
757
yy25 :
749
758
yych = * ++ YYCURSOR ;
750
759
if (yych <= ',' ) {
@@ -769,15 +778,15 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
769
778
yych = * ++ YYCURSOR ;
770
779
if (yych != '"' ) goto yy18 ;
771
780
++ YYCURSOR ;
772
- #line 652 "ext/standard/var_unserializer.re"
781
+ #line 661 "ext/standard/var_unserializer.re"
773
782
{
774
783
775
784
INIT_PZVAL (* rval );
776
785
777
786
return object_common2 (UNSERIALIZE_PASSTHRU ,
778
787
object_common1 (UNSERIALIZE_PASSTHRU , ZEND_STANDARD_CLASS_DEF_PTR ));
779
788
}
780
- #line 781 "ext/standard/var_unserializer.c"
789
+ #line 790 "ext/standard/var_unserializer.c"
781
790
yy32 :
782
791
yych = * ++ YYCURSOR ;
783
792
if (yych == '+' ) goto yy33 ;
@@ -798,7 +807,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
798
807
yych = * ++ YYCURSOR ;
799
808
if (yych != '{' ) goto yy18 ;
800
809
++ YYCURSOR ;
801
- #line 632 "ext/standard/var_unserializer.re"
810
+ #line 641 "ext/standard/var_unserializer.re"
802
811
{
803
812
long elements = parse_iv (start + 2 );
804
813
/* use iv() not uiv() in order to check data range */
@@ -818,7 +827,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
818
827
819
828
return finish_nested_data (UNSERIALIZE_PASSTHRU );
820
829
}
821
- #line 822 "ext/standard/var_unserializer.c"
830
+ #line 831 "ext/standard/var_unserializer.c"
822
831
yy39 :
823
832
yych = * ++ YYCURSOR ;
824
833
if (yych == '+' ) goto yy40 ;
@@ -839,7 +848,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
839
848
yych = * ++ YYCURSOR ;
840
849
if (yych != '"' ) goto yy18 ;
841
850
++ YYCURSOR ;
842
- #line 603 "ext/standard/var_unserializer.re"
851
+ #line 612 "ext/standard/var_unserializer.re"
843
852
{
844
853
size_t len , maxlen ;
845
854
char * str ;
@@ -868,7 +877,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
868
877
ZVAL_STRINGL (* rval , str , len , 0 );
869
878
return 1 ;
870
879
}
871
- #line 872 "ext/standard/var_unserializer.c"
880
+ #line 881 "ext/standard/var_unserializer.c"
872
881
yy46 :
873
882
yych = * ++ YYCURSOR ;
874
883
if (yych == '+' ) goto yy47 ;
@@ -889,7 +898,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
889
898
yych = * ++ YYCURSOR ;
890
899
if (yych != '"' ) goto yy18 ;
891
900
++ YYCURSOR ;
892
- #line 575 "ext/standard/var_unserializer.re"
901
+ #line 584 "ext/standard/var_unserializer.re"
893
902
{
894
903
size_t len , maxlen ;
895
904
char * str ;
@@ -917,7 +926,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
917
926
ZVAL_STRINGL (* rval , str , len , 1 );
918
927
return 1 ;
919
928
}
920
- #line 921 "ext/standard/var_unserializer.c"
929
+ #line 930 "ext/standard/var_unserializer.c"
921
930
yy53 :
922
931
yych = * ++ YYCURSOR ;
923
932
if (yych <= '/' ) {
@@ -1005,7 +1014,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1005
1014
}
1006
1015
yy63 :
1007
1016
++ YYCURSOR ;
1008
- #line 565 "ext/standard/var_unserializer.re"
1017
+ #line 574 "ext/standard/var_unserializer.re"
1009
1018
{
1010
1019
#if SIZEOF_LONG == 4
1011
1020
use_double :
@@ -1015,7 +1024,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1015
1024
ZVAL_DOUBLE (* rval , zend_strtod ((const char * )start + 2 , NULL ));
1016
1025
return 1 ;
1017
1026
}
1018
- #line 1019 "ext/standard/var_unserializer.c"
1027
+ #line 1028 "ext/standard/var_unserializer.c"
1019
1028
yy65 :
1020
1029
yych = * ++ YYCURSOR ;
1021
1030
if (yych <= ',' ) {
@@ -1074,7 +1083,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1074
1083
yych = * ++ YYCURSOR ;
1075
1084
if (yych != ';' ) goto yy18 ;
1076
1085
++ YYCURSOR ;
1077
- #line 550 "ext/standard/var_unserializer.re"
1086
+ #line 559 "ext/standard/var_unserializer.re"
1078
1087
{
1079
1088
* p = YYCURSOR ;
1080
1089
INIT_PZVAL (* rval );
@@ -1089,7 +1098,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1089
1098
1090
1099
return 1 ;
1091
1100
}
1092
- #line 1093 "ext/standard/var_unserializer.c"
1101
+ #line 1102 "ext/standard/var_unserializer.c"
1093
1102
yy76 :
1094
1103
yych = * ++ YYCURSOR ;
1095
1104
if (yych == 'N' ) goto yy73 ;
@@ -1116,7 +1125,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1116
1125
if (yych <= '9' ) goto yy79 ;
1117
1126
if (yych != ';' ) goto yy18 ;
1118
1127
++ YYCURSOR ;
1119
- #line 523 "ext/standard/var_unserializer.re"
1128
+ #line 532 "ext/standard/var_unserializer.re"
1120
1129
{
1121
1130
#if SIZEOF_LONG == 4
1122
1131
int digits = YYCURSOR - start - 3 ;
@@ -1143,32 +1152,32 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1143
1152
ZVAL_LONG (* rval , parse_iv (start + 2 ));
1144
1153
return 1 ;
1145
1154
}
1146
- #line 1147 "ext/standard/var_unserializer.c"
1155
+ #line 1156 "ext/standard/var_unserializer.c"
1147
1156
yy83 :
1148
1157
yych = * ++ YYCURSOR ;
1149
1158
if (yych <= '/' ) goto yy18 ;
1150
1159
if (yych >= '2' ) goto yy18 ;
1151
1160
yych = * ++ YYCURSOR ;
1152
1161
if (yych != ';' ) goto yy18 ;
1153
1162
++ YYCURSOR ;
1154
- #line 516 "ext/standard/var_unserializer.re"
1163
+ #line 525 "ext/standard/var_unserializer.re"
1155
1164
{
1156
1165
* p = YYCURSOR ;
1157
1166
INIT_PZVAL (* rval );
1158
1167
ZVAL_BOOL (* rval , parse_iv (start + 2 ));
1159
1168
return 1 ;
1160
1169
}
1161
- #line 1162 "ext/standard/var_unserializer.c"
1170
+ #line 1171 "ext/standard/var_unserializer.c"
1162
1171
yy87 :
1163
1172
++ YYCURSOR ;
1164
- #line 509 "ext/standard/var_unserializer.re"
1173
+ #line 518 "ext/standard/var_unserializer.re"
1165
1174
{
1166
1175
* p = YYCURSOR ;
1167
1176
INIT_PZVAL (* rval );
1168
1177
ZVAL_NULL (* rval );
1169
1178
return 1 ;
1170
1179
}
1171
- #line 1172 "ext/standard/var_unserializer.c"
1180
+ #line 1181 "ext/standard/var_unserializer.c"
1172
1181
yy89 :
1173
1182
yych = * ++ YYCURSOR ;
1174
1183
if (yych <= ',' ) {
@@ -1191,7 +1200,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1191
1200
if (yych <= '9' ) goto yy91 ;
1192
1201
if (yych != ';' ) goto yy18 ;
1193
1202
++ YYCURSOR ;
1194
- #line 486 "ext/standard/var_unserializer.re"
1203
+ #line 495 "ext/standard/var_unserializer.re"
1195
1204
{
1196
1205
long id ;
1197
1206
@@ -1214,7 +1223,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1214
1223
1215
1224
return 1 ;
1216
1225
}
1217
- #line 1218 "ext/standard/var_unserializer.c"
1226
+ #line 1227 "ext/standard/var_unserializer.c"
1218
1227
yy95 :
1219
1228
yych = * ++ YYCURSOR ;
1220
1229
if (yych <= ',' ) {
@@ -1237,7 +1246,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1237
1246
if (yych <= '9' ) goto yy97 ;
1238
1247
if (yych != ';' ) goto yy18 ;
1239
1248
++ YYCURSOR ;
1240
- #line 465 "ext/standard/var_unserializer.re"
1249
+ #line 474 "ext/standard/var_unserializer.re"
1241
1250
{
1242
1251
long id ;
1243
1252
@@ -1258,9 +1267,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1258
1267
1259
1268
return 1 ;
1260
1269
}
1261
- #line 1262 "ext/standard/var_unserializer.c"
1270
+ #line 1271 "ext/standard/var_unserializer.c"
1262
1271
}
1263
- #line 814 "ext/standard/var_unserializer.re"
1272
+ #line 823 "ext/standard/var_unserializer.re"
1264
1273
1265
1274
1266
1275
return 0 ;
0 commit comments