1
- /* Generated by re2c 0.13.5 on Tue Jun 3 10:23:35 2014 */
1
+ /* Generated by re2c 0.13.5 on Sat Jun 21 21:27:56 2014 */
2
2
#line 1 "ext/standard/var_unserializer.re"
3
3
/*
4
4
+----------------------------------------------------------------------+
23
23
#include "php.h"
24
24
#include "ext/standard/php_var.h"
25
25
#include "php_incomplete_class.h"
26
+ #include "Zend/zend_interfaces.h"
26
27
27
28
/* {{{ reference-handling for unserializer: var_* */
28
29
#define VAR_ENTRIES_MAX 1024
@@ -226,7 +227,7 @@ static char *unserialize_str(const unsigned char **p, size_t *len, size_t maxlen
226
227
#define YYMARKER marker
227
228
228
229
229
- #line 234 "ext/standard/var_unserializer.re"
230
+ #line 235 "ext/standard/var_unserializer.re"
230
231
231
232
232
233
@@ -400,7 +401,7 @@ static inline long object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
400
401
Serializable interface have eventually an inconsistent behavior at this place when
401
402
unserialized from a manipulated string. Additionaly the interal classes can possibly
402
403
crash PHP so they're still disabled here. */
403
- if (ce -> serialize == NULL || ZEND_INTERNAL_CLASS != ce -> type ) {
404
+ if (ce -> serialize == NULL || ce -> unserialize == zend_user_unserialize || ( ZEND_INTERNAL_CLASS != ce -> type && ce -> create_object == NULL ) ) {
404
405
object_init_ex (* rval , ce );
405
406
} else {
406
407
/* If this class implements Serializable, it should not land here but in object_custom(). The passed string
@@ -473,7 +474,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
473
474
474
475
475
476
476
- #line 477 "ext/standard/var_unserializer.c"
477
+ #line 478 "ext/standard/var_unserializer.c"
477
478
{
478
479
YYCTYPE yych ;
479
480
static const unsigned char yybm [] = {
@@ -533,9 +534,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
533
534
yych = * (YYMARKER = ++ YYCURSOR );
534
535
if (yych == ':' ) goto yy95 ;
535
536
yy3 :
536
- #line 828 "ext/standard/var_unserializer.re"
537
+ #line 829 "ext/standard/var_unserializer.re"
537
538
{ return 0 ; }
538
- #line 539 "ext/standard/var_unserializer.c"
539
+ #line 540 "ext/standard/var_unserializer.c"
539
540
yy4 :
540
541
yych = * (YYMARKER = ++ YYCURSOR );
541
542
if (yych == ':' ) goto yy89 ;
@@ -578,13 +579,13 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
578
579
goto yy3 ;
579
580
yy14 :
580
581
++ YYCURSOR ;
581
- #line 822 "ext/standard/var_unserializer.re"
582
+ #line 823 "ext/standard/var_unserializer.re"
582
583
{
583
584
/* this is the case where we have less data than planned */
584
585
php_error_docref (NULL TSRMLS_CC , E_NOTICE , "Unexpected end of serialized data" );
585
586
return 0 ; /* not sure if it should be 0 or 1 here? */
586
587
}
587
- #line 588 "ext/standard/var_unserializer.c"
588
+ #line 589 "ext/standard/var_unserializer.c"
588
589
yy16 :
589
590
yych = * ++ YYCURSOR ;
590
591
goto yy3 ;
@@ -614,7 +615,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
614
615
yych = * ++ YYCURSOR ;
615
616
if (yych != '"' ) goto yy18 ;
616
617
++ YYCURSOR ;
617
- #line 676 "ext/standard/var_unserializer.re"
618
+ #line 677 "ext/standard/var_unserializer.re"
618
619
{
619
620
size_t len , len2 , len3 , maxlen ;
620
621
long elements ;
@@ -760,7 +761,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
760
761
761
762
return object_common2 (UNSERIALIZE_PASSTHRU , elements );
762
763
}
763
- #line 764 "ext/standard/var_unserializer.c"
764
+ #line 765 "ext/standard/var_unserializer.c"
764
765
yy25 :
765
766
yych = * ++ YYCURSOR ;
766
767
if (yych <= ',' ) {
@@ -785,15 +786,15 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
785
786
yych = * ++ YYCURSOR ;
786
787
if (yych != '"' ) goto yy18 ;
787
788
++ YYCURSOR ;
788
- #line 668 "ext/standard/var_unserializer.re"
789
+ #line 669 "ext/standard/var_unserializer.re"
789
790
{
790
791
791
792
INIT_PZVAL (* rval );
792
793
793
794
return object_common2 (UNSERIALIZE_PASSTHRU ,
794
795
object_common1 (UNSERIALIZE_PASSTHRU , ZEND_STANDARD_CLASS_DEF_PTR ));
795
796
}
796
- #line 797 "ext/standard/var_unserializer.c"
797
+ #line 798 "ext/standard/var_unserializer.c"
797
798
yy32 :
798
799
yych = * ++ YYCURSOR ;
799
800
if (yych == '+' ) goto yy33 ;
@@ -814,7 +815,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
814
815
yych = * ++ YYCURSOR ;
815
816
if (yych != '{' ) goto yy18 ;
816
817
++ YYCURSOR ;
817
- #line 648 "ext/standard/var_unserializer.re"
818
+ #line 649 "ext/standard/var_unserializer.re"
818
819
{
819
820
long elements = parse_iv (start + 2 );
820
821
/* use iv() not uiv() in order to check data range */
@@ -834,7 +835,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
834
835
835
836
return finish_nested_data (UNSERIALIZE_PASSTHRU );
836
837
}
837
- #line 838 "ext/standard/var_unserializer.c"
838
+ #line 839 "ext/standard/var_unserializer.c"
838
839
yy39 :
839
840
yych = * ++ YYCURSOR ;
840
841
if (yych == '+' ) goto yy40 ;
@@ -855,7 +856,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
855
856
yych = * ++ YYCURSOR ;
856
857
if (yych != '"' ) goto yy18 ;
857
858
++ YYCURSOR ;
858
- #line 619 "ext/standard/var_unserializer.re"
859
+ #line 620 "ext/standard/var_unserializer.re"
859
860
{
860
861
size_t len , maxlen ;
861
862
char * str ;
@@ -884,7 +885,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
884
885
ZVAL_STRINGL (* rval , str , len , 0 );
885
886
return 1 ;
886
887
}
887
- #line 888 "ext/standard/var_unserializer.c"
888
+ #line 889 "ext/standard/var_unserializer.c"
888
889
yy46 :
889
890
yych = * ++ YYCURSOR ;
890
891
if (yych == '+' ) goto yy47 ;
@@ -905,7 +906,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
905
906
yych = * ++ YYCURSOR ;
906
907
if (yych != '"' ) goto yy18 ;
907
908
++ YYCURSOR ;
908
- #line 591 "ext/standard/var_unserializer.re"
909
+ #line 592 "ext/standard/var_unserializer.re"
909
910
{
910
911
size_t len , maxlen ;
911
912
char * str ;
@@ -933,7 +934,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
933
934
ZVAL_STRINGL (* rval , str , len , 1 );
934
935
return 1 ;
935
936
}
936
- #line 937 "ext/standard/var_unserializer.c"
937
+ #line 938 "ext/standard/var_unserializer.c"
937
938
yy53 :
938
939
yych = * ++ YYCURSOR ;
939
940
if (yych <= '/' ) {
@@ -1021,7 +1022,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1021
1022
}
1022
1023
yy63 :
1023
1024
++ YYCURSOR ;
1024
- #line 581 "ext/standard/var_unserializer.re"
1025
+ #line 582 "ext/standard/var_unserializer.re"
1025
1026
{
1026
1027
#if SIZEOF_LONG == 4
1027
1028
use_double :
@@ -1031,7 +1032,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1031
1032
ZVAL_DOUBLE (* rval , zend_strtod ((const char * )start + 2 , NULL ));
1032
1033
return 1 ;
1033
1034
}
1034
- #line 1035 "ext/standard/var_unserializer.c"
1035
+ #line 1036 "ext/standard/var_unserializer.c"
1035
1036
yy65 :
1036
1037
yych = * ++ YYCURSOR ;
1037
1038
if (yych <= ',' ) {
@@ -1090,7 +1091,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1090
1091
yych = * ++ YYCURSOR ;
1091
1092
if (yych != ';' ) goto yy18 ;
1092
1093
++ YYCURSOR ;
1093
- #line 566 "ext/standard/var_unserializer.re"
1094
+ #line 567 "ext/standard/var_unserializer.re"
1094
1095
{
1095
1096
* p = YYCURSOR ;
1096
1097
INIT_PZVAL (* rval );
@@ -1105,7 +1106,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1105
1106
1106
1107
return 1 ;
1107
1108
}
1108
- #line 1109 "ext/standard/var_unserializer.c"
1109
+ #line 1110 "ext/standard/var_unserializer.c"
1109
1110
yy76 :
1110
1111
yych = * ++ YYCURSOR ;
1111
1112
if (yych == 'N' ) goto yy73 ;
@@ -1132,7 +1133,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1132
1133
if (yych <= '9' ) goto yy79 ;
1133
1134
if (yych != ';' ) goto yy18 ;
1134
1135
++ YYCURSOR ;
1135
- #line 539 "ext/standard/var_unserializer.re"
1136
+ #line 540 "ext/standard/var_unserializer.re"
1136
1137
{
1137
1138
#if SIZEOF_LONG == 4
1138
1139
int digits = YYCURSOR - start - 3 ;
@@ -1159,32 +1160,32 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1159
1160
ZVAL_LONG (* rval , parse_iv (start + 2 ));
1160
1161
return 1 ;
1161
1162
}
1162
- #line 1163 "ext/standard/var_unserializer.c"
1163
+ #line 1164 "ext/standard/var_unserializer.c"
1163
1164
yy83 :
1164
1165
yych = * ++ YYCURSOR ;
1165
1166
if (yych <= '/' ) goto yy18 ;
1166
1167
if (yych >= '2' ) goto yy18 ;
1167
1168
yych = * ++ YYCURSOR ;
1168
1169
if (yych != ';' ) goto yy18 ;
1169
1170
++ YYCURSOR ;
1170
- #line 532 "ext/standard/var_unserializer.re"
1171
+ #line 533 "ext/standard/var_unserializer.re"
1171
1172
{
1172
1173
* p = YYCURSOR ;
1173
1174
INIT_PZVAL (* rval );
1174
1175
ZVAL_BOOL (* rval , parse_iv (start + 2 ));
1175
1176
return 1 ;
1176
1177
}
1177
- #line 1178 "ext/standard/var_unserializer.c"
1178
+ #line 1179 "ext/standard/var_unserializer.c"
1178
1179
yy87 :
1179
1180
++ YYCURSOR ;
1180
- #line 525 "ext/standard/var_unserializer.re"
1181
+ #line 526 "ext/standard/var_unserializer.re"
1181
1182
{
1182
1183
* p = YYCURSOR ;
1183
1184
INIT_PZVAL (* rval );
1184
1185
ZVAL_NULL (* rval );
1185
1186
return 1 ;
1186
1187
}
1187
- #line 1188 "ext/standard/var_unserializer.c"
1188
+ #line 1189 "ext/standard/var_unserializer.c"
1188
1189
yy89 :
1189
1190
yych = * ++ YYCURSOR ;
1190
1191
if (yych <= ',' ) {
@@ -1207,7 +1208,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1207
1208
if (yych <= '9' ) goto yy91 ;
1208
1209
if (yych != ';' ) goto yy18 ;
1209
1210
++ YYCURSOR ;
1210
- #line 502 "ext/standard/var_unserializer.re"
1211
+ #line 503 "ext/standard/var_unserializer.re"
1211
1212
{
1212
1213
long id ;
1213
1214
@@ -1230,7 +1231,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1230
1231
1231
1232
return 1 ;
1232
1233
}
1233
- #line 1234 "ext/standard/var_unserializer.c"
1234
+ #line 1235 "ext/standard/var_unserializer.c"
1234
1235
yy95 :
1235
1236
yych = * ++ YYCURSOR ;
1236
1237
if (yych <= ',' ) {
@@ -1253,7 +1254,7 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1253
1254
if (yych <= '9' ) goto yy97 ;
1254
1255
if (yych != ';' ) goto yy18 ;
1255
1256
++ YYCURSOR ;
1256
- #line 481 "ext/standard/var_unserializer.re"
1257
+ #line 482 "ext/standard/var_unserializer.re"
1257
1258
{
1258
1259
long id ;
1259
1260
@@ -1274,9 +1275,9 @@ PHPAPI int php_var_unserialize(UNSERIALIZE_PARAMETER)
1274
1275
1275
1276
return 1 ;
1276
1277
}
1277
- #line 1278 "ext/standard/var_unserializer.c"
1278
+ #line 1279 "ext/standard/var_unserializer.c"
1278
1279
}
1279
- #line 830 "ext/standard/var_unserializer.re"
1280
+ #line 831 "ext/standard/var_unserializer.re"
1280
1281
1281
1282
1282
1283
return 0 ;
0 commit comments