-/* Generated by re2c 0.9.4 on Wed Mar 2 01:25:31 2005 */
+/* Generated by re2c 0.9.4 on Thu Mar 10 02:54:37 2005 */
#line 1 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
/*
+----------------------------------------------------------------------+
typedef struct {
zval *data[VAR_ENTRIES_MAX];
- int used_slots;
+ long used_slots;
void *next;
} var_entries;
PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval)
{
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
}
}
-static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
+static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store)
{
var_entries *var_hash = var_hashx->first;
PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
{
void *next;
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
-static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int elements)
+static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements)
{
while (elements-- > 0) {
zval *key, *data, **old_data;
static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- int elements;
+ long elements;
elements = parse_iv2((*p) + 2, p);
return elements;
}
-static inline int object_common2(UNSERIALIZE_PARAMETER, int elements)
+static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
{
zval *retval_ptr = NULL;
zval fname;
if(yych == ':') goto yy87;
goto yy4;
yy4:
-#line 585 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 589 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{ return 0; }
#line 102 "<stdout>"
yy5: yyaccept = 0;
yy14: ++YYCURSOR;
goto yy15;
yy15:
-#line 579 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 583 "/usr/src/php/php_5_0/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");
yy22: ++YYCURSOR;
goto yy23;
yy23:
-#line 479 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 483 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{
size_t len, len2, len3, maxlen;
- int elements;
+ long elements;
char *class_name;
zend_class_entry *ce;
zend_class_entry **pce;
yy29: ++YYCURSOR;
goto yy30;
yy30:
-#line 471 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 475 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{
INIT_PZVAL(*rval);
yy37:
#line 449 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{
- int elements = parse_iv(start + 2);
-
+ long elements = parse_iv(start + 2);
+ /* use iv() not uiv() in order to check data range */
*p = YYCURSOR;
if (elements < 0) {
return 0;
}
+ if (elements < 0) {
+ return 0;
+ }
+
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
return finish_nested_data(UNSERIALIZE_PASSTHRU);
}
-#line 356 "<stdout>"
+#line 360 "<stdout>"
yy38: yych = *++YYCURSOR;
if(yych == '+') goto yy39;
if(yych <= '/') goto yy2;
ZVAL_STRINGL(*rval, str, len, 1);
return 1;
}
-#line 409 "<stdout>"
+#line 413 "<stdout>"
yy45: yych = *++YYCURSOR;
if(yych <= '/'){
if(yych <= ','){
{
*p = YYCURSOR;
INIT_PZVAL(*rval);
- ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
+ ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
-#line 507 "<stdout>"
+#line 511 "<stdout>"
yy57: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy2;
return 1;
}
-#line 584 "<stdout>"
+#line 588 "<stdout>"
yy68: yych = *++YYCURSOR;
if(yych == 'N') goto yy65;
goto yy2;
ZVAL_LONG(*rval, parse_iv(start + 2));
return 1;
}
-#line 621 "<stdout>"
+#line 625 "<stdout>"
yy75: yych = *++YYCURSOR;
if(yych <= '/') goto yy2;
if(yych >= '2') goto yy2;
ZVAL_BOOL(*rval, parse_iv(start + 2));
return 1;
}
-#line 639 "<stdout>"
+#line 643 "<stdout>"
yy79: ++YYCURSOR;
goto yy80;
yy80:
ZVAL_NULL(*rval);
return 1;
}
-#line 650 "<stdout>"
+#line 654 "<stdout>"
yy81: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy2;
yy86:
#line 355 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
return 1;
}
-#line 700 "<stdout>"
+#line 704 "<stdout>"
yy87: yych = *++YYCURSOR;
if(yych <= ','){
if(yych != '+') goto yy2;
yy92:
#line 334 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
{
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
return 1;
}
-#line 748 "<stdout>"
+#line 752 "<stdout>"
}
-#line 587 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
+#line 591 "/usr/src/php/php_5_0/ext/standard/var_unserializer.re"
return 0;
typedef struct {
zval *data[VAR_ENTRIES_MAX];
- int used_slots;
+ long used_slots;
void *next;
} var_entries;
PHPAPI void var_replace(php_unserialize_data_t *var_hashx, zval *ozval, zval **nzval)
{
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
}
}
-static int var_access(php_unserialize_data_t *var_hashx, int id, zval ***store)
+static int var_access(php_unserialize_data_t *var_hashx, long id, zval ***store)
{
var_entries *var_hash = var_hashx->first;
PHPAPI void var_destroy(php_unserialize_data_t *var_hashx)
{
void *next;
- int i;
+ long i;
var_entries *var_hash = var_hashx->first;
while (var_hash) {
#define UNSERIALIZE_PARAMETER zval **rval, const unsigned char **p, const unsigned char *max, php_unserialize_data_t *var_hash TSRMLS_DC
#define UNSERIALIZE_PASSTHRU rval, p, max, var_hash TSRMLS_CC
-static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, int elements)
+static inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTable *ht, long elements)
{
while (elements-- > 0) {
zval *key, *data, **old_data;
static inline int object_common1(UNSERIALIZE_PARAMETER, zend_class_entry *ce)
{
- int elements;
+ long elements;
elements = parse_iv2((*p) + 2, p);
return elements;
}
-static inline int object_common2(UNSERIALIZE_PARAMETER, int elements)
+static inline int object_common2(UNSERIALIZE_PARAMETER, long elements)
{
zval *retval_ptr = NULL;
zval fname;
/*!re2c
"R:" iv ";" {
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
}
"r:" iv ";" {
- int id;
+ long id;
*p = YYCURSOR;
if (!var_hash) return 0;
"d:" (iv | nv | nvexp) ";" {
*p = YYCURSOR;
INIT_PZVAL(*rval);
- ZVAL_DOUBLE(*rval, zend_strtod(start + 2, NULL));
+ ZVAL_DOUBLE(*rval, zend_strtod((const char *)start + 2, NULL));
return 1;
}
}
"a:" uiv ":" "{" {
- int elements = parse_iv(start + 2);
-
+ long elements = parse_iv(start + 2);
+ /* use iv() not uiv() in order to check data range */
*p = YYCURSOR;
if (elements < 0) {
return 0;
}
+ if (elements < 0) {
+ return 0;
+ }
+
INIT_PZVAL(*rval);
Z_TYPE_PP(rval) = IS_ARRAY;
ALLOC_HASHTABLE(Z_ARRVAL_PP(rval));
"O:" uiv ":" ["] {
size_t len, len2, len3, maxlen;
- int elements;
+ long elements;
char *class_name;
zend_class_entry *ce;
zend_class_entry **pce;