This commit is contained in:
Dmitry Stogov 2006-02-21 08:00:39 +00:00
parent 7bc8d5227d
commit 2e5d0a3a9d
75 changed files with 920 additions and 920 deletions

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -328,7 +328,7 @@ struct _zend_class_entry {
char type;
char *name;
zend_uint name_length;
struct _zend_class_entry *parent;
struct _zend_class_entry *parent;
int refcount;
zend_bool constants_updated;
zend_uint ce_flags;
@ -393,7 +393,7 @@ typedef struct _zend_utility_functions {
char *(*getenv_function)(char *name, size_t name_len TSRMLS_DC);
} zend_utility_functions;
typedef struct _zend_utility_values {
char *import_use_extension;
uint import_use_extension_length;
@ -576,7 +576,7 @@ END_EXTERN_C()
#define INIT_PZVAL(z) \
(z)->refcount = 1; \
(z)->is_ref = 0;
(z)->is_ref = 0;
#define INIT_ZVAL(z) z = zval_used_for_init;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -159,7 +159,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval ***argument_arr
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(*value, &class_name, &class_name_len TSRMLS_CC);
ALLOC_ZVAL(value_ptr);
@ -196,7 +196,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
while (param_count-->0) {
zval **param = (zval **) p-(arg_count--);
zval_add_ref(param);
add_next_index_zval(argument_array, *param);
add_next_index_zval(argument_array, *param);
}
return SUCCESS;
@ -207,7 +207,7 @@ ZEND_API void zend_wrong_param_count(TSRMLS_D)
{
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "Wrong parameter count for %v%s%v()", class_name, space, get_active_function_name(TSRMLS_C));
}
@ -265,7 +265,7 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin
if (Z_OBJ_HT_P(object)->get_class_name == NULL ||
Z_OBJ_HT_P(object)->get_class_name(object, class_name, class_name_len, 0 TSRMLS_CC) != SUCCESS) {
zend_class_entry *ce = Z_OBJCE_P(object);
*class_name = ce->name;
*class_name_len = ce->name_length;
return 1;
@ -276,7 +276,7 @@ ZEND_API int zend_get_object_classname(zval *object, char **class_name, zend_uin
#define RETURN_AS_STRING(arg, p, pl, type) \
*(char**)p = Z_STRVAL_PP(arg); \
*pl = Z_STRLEN_PP(arg); \
*type = IS_STRING;
*type = IS_STRING;
#define RETURN_AS_UNICODE(arg, p, pl, type) \
*(UChar**)p = Z_USTRVAL_PP(arg); \
@ -428,7 +428,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
}
}
case IS_ARRAY:
case IS_RESOURCE:
default:
@ -472,7 +472,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
}
}
case IS_ARRAY:
case IS_RESOURCE:
default:
@ -531,7 +531,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
}
}
case IS_ARRAY:
case IS_RESOURCE:
default:
@ -593,7 +593,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
}
}
}
case IS_ARRAY:
case IS_RESOURCE:
default:
@ -722,7 +722,7 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a class name derived from %v, '%v' given",
class_name, space, get_active_function_name(TSRMLS_C),
class_name, space, get_active_function_name(TSRMLS_C),
arg_num, ce_base->name, Z_STRVAL_PP(arg));
*pce = NULL;
return "";
@ -732,12 +732,12 @@ static char *zend_parse_arg_impl(int arg_num, zval **arg, va_list *va, char **sp
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%v%s%v() expects parameter %d to be a valid class name, '%v' given",
class_name, space, get_active_function_name(TSRMLS_C),
class_name, space, get_active_function_name(TSRMLS_C),
arg_num, Z_STRVAL_PP(arg));
return "";
}
break;
}
break;
@ -786,7 +786,7 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
}
return FAILURE;
}
return SUCCESS;
}
@ -833,7 +833,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
if (!quiet) {
char *space;
char *class_name = get_active_class_name(&space TSRMLS_CC);
zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters",
zend_error(E_WARNING, "%v%s%v(): bad type specifier while parsing parameters",
class_name, space,
get_active_function_name(TSRMLS_C));
}
@ -883,7 +883,7 @@ static int zend_parse_va_args(int num_args, char *type_spec, va_list *va, int fl
}
i++;
break;
case '|': case '!':
case '/':
/* pass */
@ -915,7 +915,7 @@ ZEND_API int zend_parse_parameters_ex(int flags, int num_args TSRMLS_DC, char *t
{
va_list va;
int retval;
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, flags TSRMLS_CC);
va_end(va);
@ -927,7 +927,7 @@ ZEND_API int zend_parse_parameters(int num_args TSRMLS_DC, char *type_spec, ...)
{
va_list va;
int retval;
va_start(va, type_spec);
retval = zend_parse_va_args(num_args, type_spec, &va, 0 TSRMLS_CC);
va_end(va);
@ -1039,7 +1039,7 @@ static int zend_merge_property(zval **value, int num_args, va_list args, zend_ha
}
/* This function should be called after the constructor has been called
/* This function should be called after the constructor has been called
* because it may call __set from the uninitialized object otherwise. */
ZEND_API void zend_merge_properties(zval *obj, HashTable *properties, int destroy_ht TSRMLS_DC)
{
@ -1107,7 +1107,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
zend_u_hash_add(CE_STATIC_MEMBERS(class_type), utype, str_index, str_length, (void**)q, sizeof(zval*), NULL);
} else {
zval *q;
ALLOC_ZVAL(q);
*q = **p;
INIT_PZVAL(q);
@ -1118,7 +1118,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
}
}
zend_hash_apply_with_argument(CE_STATIC_MEMBERS(class_type), (apply_func_arg_t) zval_update_constant, (void *) 1 TSRMLS_CC);
*scope = old_scope;
class_type->constants_updated = 1;
}
@ -1126,7 +1126,7 @@ ZEND_API void zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
/* This function requires 'properties' to contain all props declared in the
* class and all props being public. If only a subset is given or the class
* class and all props being public. If only a subset is given or the class
* has protected members then you need to merge the properties seperately by
* calling zend_merge_properties(). */
ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type, HashTable *properties ZEND_FILE_LINE_DC TSRMLS_DC)
@ -1140,7 +1140,7 @@ ZEND_API int _object_and_properties_init(zval *arg, zend_class_entry *class_type
}
zend_update_class_constants(class_type TSRMLS_CC);
Z_TYPE_P(arg) = IS_OBJECT;
if (class_type->create_object == NULL) {
Z_OBJVAL_P(arg) = zend_objects_new(&object, class_type TSRMLS_CC);
@ -1181,24 +1181,24 @@ ZEND_API int add_assoc_long_ex(zval *arg, char *key, uint key_len, long n)
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_null_ex(zval *arg, char *key, uint key_len)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
@ -1208,10 +1208,10 @@ ZEND_API int add_assoc_bool_ex(zval *arg, char *key, uint key_len, int b)
ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1219,7 +1219,7 @@ ZEND_API int add_assoc_resource_ex(zval *arg, char *key, uint key_len, int r)
ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
@ -1230,7 +1230,7 @@ ZEND_API int add_assoc_double_ex(zval *arg, char *key, uint key_len, double d)
ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
@ -1241,7 +1241,7 @@ ZEND_API int add_assoc_string_ex(zval *arg, char *key, uint key_len, char *str,
ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
@ -1251,7 +1251,7 @@ ZEND_API int add_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str,
ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
@ -1262,7 +1262,7 @@ ZEND_API int add_assoc_unicode_ex(zval *arg, char *key, uint key_len, void *str,
ZEND_API int add_assoc_unicodel_ex(zval *arg, char *key, uint key_len, void *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
@ -1303,10 +1303,10 @@ ZEND_API int add_index_null(zval *arg, ulong index)
ZEND_API int add_index_bool(zval *arg, ulong index, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1314,10 +1314,10 @@ ZEND_API int add_index_bool(zval *arg, ulong index, int b)
ZEND_API int add_index_resource(zval *arg, ulong index, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1325,10 +1325,10 @@ ZEND_API int add_index_resource(zval *arg, ulong index, int r)
ZEND_API int add_index_double(zval *arg, ulong index, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1336,7 +1336,7 @@ ZEND_API int add_index_double(zval *arg, ulong index, double d)
ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
@ -1347,10 +1347,10 @@ ZEND_API int add_index_string(zval *arg, ulong index, char *str, int duplicate)
ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1358,7 +1358,7 @@ ZEND_API int add_index_stringl(zval *arg, ulong index, char *str, uint length, i
ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
@ -1369,10 +1369,10 @@ ZEND_API int add_index_unicode(zval *arg, ulong index, UChar *str, int duplicate
ZEND_API int add_index_unicodel(zval *arg, ulong index, UChar *str, uint length, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), NULL);
}
@ -1386,10 +1386,10 @@ ZEND_API int add_index_zval(zval *arg, ulong index, zval *value)
ZEND_API int add_next_index_long(zval *arg, long n)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@ -1397,10 +1397,10 @@ ZEND_API int add_next_index_long(zval *arg, long n)
ZEND_API int add_next_index_null(zval *arg)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@ -1408,10 +1408,10 @@ ZEND_API int add_next_index_null(zval *arg)
ZEND_API int add_next_index_bool(zval *arg, int b)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_BOOL(tmp, b);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@ -1419,10 +1419,10 @@ ZEND_API int add_next_index_bool(zval *arg, int b)
ZEND_API int add_next_index_resource(zval *arg, int r)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, r);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@ -1430,10 +1430,10 @@ ZEND_API int add_next_index_resource(zval *arg, int r)
ZEND_API int add_next_index_double(zval *arg, double d)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_next_index_insert(Z_ARRVAL_P(arg), &tmp, sizeof(zval *), NULL);
}
@ -1491,10 +1491,10 @@ ZEND_API int add_next_index_zval(zval *arg, zval *value)
ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *str, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_symtable_update(Z_ARRVAL_P(arg), key, key_len, (void *) &tmp, sizeof(zval *), dest);
}
@ -1502,7 +1502,7 @@ ZEND_API int add_get_assoc_string_ex(zval *arg, char *key, uint key_len, char *s
ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
@ -1513,10 +1513,10 @@ ZEND_API int add_get_assoc_stringl_ex(zval *arg, char *key, uint key_len, char *
ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, l);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@ -1524,10 +1524,10 @@ ZEND_API int add_get_index_long(zval *arg, ulong index, long l, void **dest)
ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@ -1535,10 +1535,10 @@ ZEND_API int add_get_index_double(zval *arg, ulong index, double d, void **dest)
ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRING(tmp, str, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@ -1546,20 +1546,20 @@ ZEND_API int add_get_index_string(zval *arg, ulong index, char *str, void **dest
ZEND_API int add_get_index_stringl(zval *arg, ulong index, char *str, uint length, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_STRINGL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODE(tmp, str, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@ -1567,10 +1567,10 @@ ZEND_API int add_get_index_unicode(zval *arg, ulong index, UChar *str, void **de
ZEND_API int add_get_index_unicodel(zval *arg, ulong index, UChar *str, uint length, void **dest, int duplicate)
{
zval *tmp;
MAKE_STD_ZVAL(tmp);
ZVAL_UNICODEL(tmp, str, length, duplicate);
return zend_hash_index_update(Z_ARRVAL_P(arg), index, (void *) &tmp, sizeof(zval *), dest);
}
@ -1581,7 +1581,7 @@ ZEND_API int add_property_long_ex(zval *arg, char *key, uint key_len, long n TSR
MAKE_STD_ZVAL(tmp);
ZVAL_LONG(tmp, n);
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
@ -1612,10 +1612,10 @@ ZEND_API int add_property_null_ex(zval *arg, char *key, uint key_len TSRMLS_DC)
{
zval *tmp;
zval *z_key;
MAKE_STD_ZVAL(tmp);
ZVAL_NULL(tmp);
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
@ -1629,7 +1629,7 @@ ZEND_API int add_property_resource_ex(zval *arg, char *key, uint key_len, long n
{
zval *tmp;
zval *z_key;
MAKE_STD_ZVAL(tmp);
ZVAL_RESOURCE(tmp, n);
@ -1650,7 +1650,7 @@ ZEND_API int add_property_double_ex(zval *arg, char *key, uint key_len, double d
MAKE_STD_ZVAL(tmp);
ZVAL_DOUBLE(tmp, d);
MAKE_STD_ZVAL(z_key);
ZVAL_ASCII_STRINGL(z_key, key, key_len-1, 1);
@ -1837,7 +1837,7 @@ ZEND_API int zend_startup_module_ex(zend_module_entry *module TSRMLS_DC)
zend_error(E_CORE_WARNING, "Cannot load module '%s' because required module '%s' is not loaded", module->name, dep->name);
module->module_started = 0;
return FAILURE;
}
}
efree(lcname);
}
++dep;
@ -1861,7 +1861,7 @@ static void zend_sort_modules(void *base, size_t count, size_t siz, compare_func
Bucket **b1 = base;
Bucket **b2;
Bucket **end = b1 + count;
Bucket *tmp;
Bucket *tmp;
zend_module_entry *m, *r;
while (b1 < end) {
@ -1877,14 +1877,14 @@ try_again:
if (strcasecmp(dep->name, r->name) == 0) {
tmp = *b1;
*b1 = *b2;
*b2 = tmp;
*b2 = tmp;
goto try_again;
}
b2++;
}
}
dep++;
}
}
}
b1++;
}
@ -1902,7 +1902,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
int name_len;
char *lcname;
zend_module_entry *module_ptr;
if (!module) {
return NULL;
}
@ -1925,7 +1925,7 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module TS
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module '%s' because conflicting module '%s' is already loaded", module->name, dep->name);
return NULL;
}
}
efree(lcname);
}
++dep;
@ -1968,7 +1968,7 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_
int name_len;
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
/* we don't care if the function name is longer, in fact lowercasing only
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
if (UG(unicode)) {
name_len = u_strlen((UChar*)fptr->common.function_name);
@ -1977,7 +1977,7 @@ ZEND_API void zend_check_magic_method_implementation(zend_class_entry *ce, zend_
}
lcname = zend_u_str_case_fold(utype, fptr->common.function_name, name_len, 0, &lcname_len);
if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 &&
if (lcname_len == sizeof(ZEND_DESTRUCTOR_FUNC_NAME) - 1 &&
ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_DESTRUCTOR_FUNC_NAME, sizeof(ZEND_DESTRUCTOR_FUNC_NAME)-1) && fptr->common.num_args != 0) {
zend_error(error_type, "Destuctor %v::%s() cannot take arguments", ce->name, ZEND_DESTRUCTOR_FUNC_NAME);
} else if (lcname_len == sizeof(ZEND_CLONE_FUNC_NAME) - 1 &&
@ -2231,7 +2231,7 @@ ZEND_API int zend_register_functions(zend_class_entry *scope, zend_function_entr
return SUCCESS;
}
/* count=-1 means erase all functions, otherwise,
/* count=-1 means erase all functions, otherwise,
* erase the first count functions
*/
ZEND_API void zend_unregister_functions(zend_function_entry *functions, int count, HashTable *function_table TSRMLS_DC)
@ -2260,7 +2260,7 @@ ZEND_API void zend_unregister_functions(zend_function_entry *functions, int coun
ZEND_API int zend_startup_module(zend_module_entry *module)
{
TSRMLS_FETCH();
if ((module = zend_register_internal_module(module TSRMLS_CC)) != NULL &&
zend_startup_module_ex(module TSRMLS_CC) == SUCCESS) {
return SUCCESS;
@ -2272,7 +2272,7 @@ ZEND_API int zend_startup_module(zend_module_entry *module)
ZEND_API int zend_get_module_started(char *module_name)
{
zend_module_entry *module;
return (zend_hash_find(&module_registry, module_name, strlen(module_name)+1, (void**)&module) == SUCCESS && module->module_started) ? SUCCESS : FAILURE;
}
@ -2410,7 +2410,7 @@ ZEND_API void zend_class_implements(zend_class_entry *class_entry TSRMLS_DC, int
} else {
class_entry->interfaces = erealloc(class_entry->interfaces, sizeof(zend_class_entry*) * (class_entry->num_interfaces+num_interfaces));
}
while (num_interfaces--) {
interface_entry = va_arg(interface_list, zend_class_entry *);
class_entry->interfaces[class_entry->num_interfaces++] = interface_entry;
@ -2499,7 +2499,7 @@ ZEND_API int zend_disable_class(char *class_name, uint class_name_length TSRMLS_
{
zend_class_entry *disabled_class;
disabled_class = (zend_class_entry *) emalloc(sizeof(zend_class_entry));
zend_str_tolower(class_name, class_name_length);
if (zend_hash_del(CG(class_table), class_name, class_name_length+1)==FAILURE) {
return FAILURE;
@ -2518,7 +2518,7 @@ static int zend_is_callable_check_func(int check_flags, zval ***zobj_ptr_ptr, ze
zend_function *fptr;
zend_class_entry **pce;
HashTable *ftable;
*ce_ptr = NULL;
*fptr_ptr = NULL;
@ -2632,7 +2632,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c
if (check_flags & IS_CALLABLE_CHECK_SYNTAX_ONLY) {
return 1;
}
return zend_is_callable_check_func(check_flags|IS_CALLABLE_CHECK_IS_STATIC, zobj_ptr_ptr, NULL, callable, ce_ptr, fptr_ptr TSRMLS_CC);
case IS_ARRAY:
@ -2640,7 +2640,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c
zend_class_entry *ce = NULL;
zval **method;
zval **obj;
if (zend_hash_num_elements(Z_ARRVAL_P(callable)) == 2 &&
zend_hash_index_find(Z_ARRVAL_P(callable), 0, (void **) &obj) == SUCCESS &&
zend_hash_index_find(Z_ARRVAL_P(callable), 1, (void **) &method) == SUCCESS &&
@ -2727,7 +2727,7 @@ ZEND_API zend_bool zend_is_callable_ex(zval *callable, uint check_flags, zval *c
efree(lcname);
} else {
ce = Z_OBJCE_PP(obj); /* TBFixed: what if it's overloaded? */
*zobj_ptr_ptr = obj;
if (callable_name) {
@ -2816,7 +2816,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS
switch (Z_TYPE_P(callable)) {
case IS_STRING:
lcname = zend_str_tolower_dup(Z_STRVAL_P(callable), Z_STRLEN_P(callable));
if ((func = strstr(lcname, "::")) != NULL) {
*func = '\0';
class_name_len = func - lcname;
@ -2827,7 +2827,7 @@ ZEND_API zend_bool zend_make_callable(zval *callable, zval *callable_name TSRMLS
add_next_index_stringl(callable, lcname, class_name_len, 1);
func += 2;
add_next_index_stringl(callable, func, strlen(func), 1);
retval = 1;
retval = 1;
}
efree(class_name);
}
@ -2905,8 +2905,8 @@ ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, v
pefree(prot_name, ce->type & ZEND_INTERNAL_CLASS);
}
zend_u_hash_update(target_symbol_table, type, name, name_length+1, &property, sizeof(zval *), NULL);
property_info.name = ce->type & ZEND_INTERNAL_CLASS ?
(type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) :
property_info.name = ce->type & ZEND_INTERNAL_CLASS ?
(type==IS_UNICODE?(char*)zend_ustrndup(name, name_length):zend_strndup(name, name_length)) :
(type==IS_UNICODE?(char*)eustrndup(name, name_length):estrndup(name, name_length));
property_info.name_length = name_length;
break;
@ -2916,7 +2916,7 @@ ZEND_API int zend_u_declare_property_ex(zend_class_entry *ce, zend_uchar type, v
property_info.doc_comment = doc_comment;
property_info.doc_comment_len = doc_comment_len;
zend_u_hash_update(&ce->properties_info, type, name, name_length + 1, &property_info, sizeof(zend_property_info), NULL);
return SUCCESS;
@ -2940,7 +2940,7 @@ ZEND_API int zend_declare_property(zend_class_entry *ce, char *name, int name_le
ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int name_length, int access_type TSRMLS_DC)
{
zval *property;
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@ -2953,7 +2953,7 @@ ZEND_API int zend_declare_property_null(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@ -2967,7 +2967,7 @@ ZEND_API int zend_declare_property_bool(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int name_length, long value, int access_type TSRMLS_DC)
{
zval *property;
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@ -2981,7 +2981,7 @@ ZEND_API int zend_declare_property_long(zend_class_entry *ce, char *name, int na
ZEND_API int zend_declare_property_double(zend_class_entry *ce, char *name, int name_length, double value, int access_type TSRMLS_DC)
{
zval *property;
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
} else {
@ -2996,7 +2996,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
{
zval *property;
int len = strlen(value);
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, len), len, 0);
@ -3011,7 +3011,7 @@ ZEND_API int zend_declare_property_string(zend_class_entry *ce, char *name, int
ZEND_API int zend_declare_property_stringl(zend_class_entry *ce, char *name, int name_length, char *value, int value_len, int access_type TSRMLS_DC)
{
zval *property;
if (ce->type & ZEND_INTERNAL_CLASS) {
property = malloc(sizeof(zval));
ZVAL_STRINGL(property, zend_strndup(value, value_len), value_len, 0);
@ -3094,7 +3094,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
{
zval *property;
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->write_property) {
@ -3102,7 +3102,7 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, char *
zend_uint class_name_len;
zend_get_object_classname(object, &class_name, &class_name_len TSRMLS_CC);
zend_error(E_CORE_ERROR, "Property %s of class %v cannot be updated", name, class_name);
}
MAKE_STD_ZVAL(property);
@ -3127,7 +3127,7 @@ ZEND_API void zend_update_property_null(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3138,7 +3138,7 @@ ZEND_API void zend_update_property_bool(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3149,7 +3149,7 @@ ZEND_API void zend_update_property_long(zend_class_entry *scope, zval *object, c
ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3160,7 +3160,7 @@ ZEND_API void zend_update_property_double(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3171,7 +3171,7 @@ ZEND_API void zend_update_property_string(zend_class_entry *scope, zval *object,
ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3182,7 +3182,7 @@ ZEND_API void zend_update_property_stringl(zend_class_entry *scope, zval *object
ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3193,7 +3193,7 @@ ZEND_API void zend_update_property_ascii_string(zend_class_entry *scope, zval *o
ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3204,7 +3204,7 @@ ZEND_API void zend_update_property_ascii_stringl(zend_class_entry *scope, zval *
ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *object, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3215,7 +3215,7 @@ ZEND_API void zend_update_property_rt_string(zend_class_entry *scope, zval *obje
ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *object, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3226,7 +3226,7 @@ ZEND_API void zend_update_property_rt_stringl(zend_class_entry *scope, zval *obj
ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3237,7 +3237,7 @@ ZEND_API void zend_update_property_unicode(zend_class_entry *scope, zval *object
ZEND_API void zend_update_property_unicodel(zend_class_entry *scope, zval *object, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3249,7 +3249,7 @@ ZEND_API int zend_update_static_property(zend_class_entry *scope, char *name, in
{
zval **property;
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
property = zend_std_get_static_property(scope, IS_STRING, name, name_length, 0 TSRMLS_CC);
EG(scope) = old_scope;
@ -3293,7 +3293,7 @@ ZEND_API int zend_update_static_property_null(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3304,7 +3304,7 @@ ZEND_API int zend_update_static_property_bool(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *name, int name_length, long value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3315,7 +3315,7 @@ ZEND_API int zend_update_static_property_long(zend_class_entry *scope, char *nam
ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *name, int name_length, double value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3326,7 +3326,7 @@ ZEND_API int zend_update_static_property_double(zend_class_entry *scope, char *n
ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3337,7 +3337,7 @@ ZEND_API int zend_update_static_property_string(zend_class_entry *scope, char *n
ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3348,7 +3348,7 @@ ZEND_API int zend_update_static_property_stringl(zend_class_entry *scope, char *
ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3359,7 +3359,7 @@ ZEND_API int zend_update_static_property_ascii_string(zend_class_entry *scope, c
ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3370,7 +3370,7 @@ ZEND_API int zend_update_static_property_ascii_stringl(zend_class_entry *scope,
ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char *name, int name_length, char *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3381,7 +3381,7 @@ ZEND_API int zend_update_static_property_rt_string(zend_class_entry *scope, char
ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, char *name, int name_length, char *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3392,7 +3392,7 @@ ZEND_API int zend_update_static_property_rt_stringl(zend_class_entry *scope, cha
ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *name, int name_length, UChar *value TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3403,7 +3403,7 @@ ZEND_API int zend_update_static_property_unicode(zend_class_entry *scope, char *
ZEND_API int zend_update_static_property_unicodel(zend_class_entry *scope, char *name, int name_length, UChar *value, int value_len TSRMLS_DC)
{
zval *tmp;
ALLOC_ZVAL(tmp);
tmp->is_ref = 0;
tmp->refcount = 0;
@ -3415,7 +3415,7 @@ ZEND_API zval *zend_read_property(zend_class_entry *scope, zval *object, char *n
{
zval *property, *value;
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
if (!Z_OBJ_HT_P(object)->read_property) {
@ -3439,7 +3439,7 @@ ZEND_API zval *zend_read_static_property(zend_class_entry *scope, char *name, in
{
zval **property;
zend_class_entry *old_scope = EG(scope);
EG(scope) = scope;
property = zend_std_get_static_property(scope, IS_STRING, name, name_length, silent TSRMLS_CC);
EG(scope) = old_scope;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -555,14 +555,14 @@ ZEND_API int add_property_unicodel_ex(zval *arg, char *key, uint key_len, UChar
#define add_property_null(__arg, __key) add_property_null_ex(__arg, __key, strlen(__key) + 1 TSRMLS_CC)
#define add_property_bool(__arg, __key, __b) add_property_bool_ex(__arg, __key, strlen(__key)+1, __b TSRMLS_CC)
#define add_property_resource(__arg, __key, __r) add_property_resource_ex(__arg, __key, strlen(__key)+1, __r TSRMLS_CC)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_double(__arg, __key, __d) add_property_double_ex(__arg, __key, strlen(__key)+1, __d TSRMLS_CC)
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_ascii_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_ascii_stringl(__arg, __key, __str, __length, __duplicate) add_property_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_rt_string(__arg, __key, __str, __duplicate) add_property_ascii_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_rt_stringl(__arg, __key, __str, __length, __duplicate) add_property_rt_stringl_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
#define add_property_zval(__arg, __key, __value) add_property_zval_ex(__arg, __key, strlen(__key)+1, __value TSRMLS_CC)
#define add_property_unicode(__arg, __key, __str, __duplicate) add_property_unicode_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
#define add_property_unicodel(__arg, __key, __str, __length, __duplicate) add_property_unicodel_ex(__arg, __key, strlen(__key)+1, __str, __length, __duplicate TSRMLS_CC)
@ -942,7 +942,7 @@ END_EXTERN_C()
#define ZEND_MINFO_FUNCTION ZEND_MODULE_INFO_D
END_EXTERN_C()
#endif /* ZEND_API_H */

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -306,7 +306,7 @@ ZEND_API void _efree(void *ptr ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
#if MEMORY_LIMIT
AG(allocated_memory) -= SIZE;
#endif
ZEND_DO_FREE(p);
HANDLE_UNBLOCK_INTERRUPTIONS();
}
@ -316,7 +316,7 @@ ZEND_API void *_ecalloc(size_t nmemb, size_t size ZEND_FILE_LINE_DC ZEND_FILE_LI
{
void *p;
int final_size = size*nmemb;
HANDLE_BLOCK_INTERRUPTIONS();
p = _emalloc(final_size ZEND_FILE_LINE_RELAY_CC ZEND_FILE_LINE_ORIG_RELAY_CC);
if (!p) {
@ -385,7 +385,7 @@ ZEND_API void *_erealloc(void *ptr, size_t size, int allow_failure ZEND_FILE_LIN
p->lineno = __zend_lineno;
p->magic = MEM_BLOCK_START_MAGIC;
memcpy((((char *) p) + sizeof(zend_mem_header) + MEM_HEADER_PADDING + size), &mem_block_end_magic, sizeof(long));
#endif
#endif
p->size = size;
@ -510,7 +510,7 @@ ZEND_API int zend_set_memory_limit(unsigned int memory_limit)
ZEND_API void start_memory_manager(TSRMLS_D)
{
AG(head) = NULL;
#if MEMORY_LIMIT
AG(memory_limit) = 1<<30; /* ridiculous limit, effectively no limit */
AG(allocated_memory) = 0;
@ -683,7 +683,7 @@ ZEND_API void shutdown_memory_manager(int silent, int full_shutdown TSRMLS_DC)
}
fprintf(stderr, "\n");
}
} while (0);
#endif
@ -821,7 +821,7 @@ ZEND_API int _mem_block_check(void *ptr, int silent ZEND_FILE_LINE_DC ZEND_FILE_
zend_debug_alloc_output("Unknown\n");
}
}
if (!silent) {
zend_debug_alloc_output("---------------------------------------\n");
}
@ -836,7 +836,7 @@ ZEND_API void _full_mem_check(int silent ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_D
TSRMLS_FETCH();
p = AG(head);
zend_debug_alloc_output("------------------------------------------------\n");
zend_debug_alloc_output("Full Memory Check at %s:%d\n" ZEND_FILE_LINE_RELAY_CC);

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -42,4 +42,3 @@ ZEND_END_ARG_INFO();
ZEND_BEGIN_ARG_INFO(all_args_by_ref, 1)
ZEND_END_ARG_INFO();

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -267,7 +267,7 @@ static int lookup_cv(zend_op_array *op_array, zend_uchar type, void *name, int n
i = op_array->last_var;
op_array->last_var++;
if (op_array->last_var > op_array->size_var) {
op_array->size_var += 16; /* FIXME */
op_array->size_var += 16; /* FIXME */
op_array->vars = erealloc(op_array->vars, op_array->size_var*sizeof(zend_compiled_variable));
}
op_array->vars[i].name = name; /* estrndup(name, name_len); */
@ -319,7 +319,7 @@ void zend_do_binary_assign_op(zend_uchar op, znode *result, znode *op1, znode *o
if (last_op_number > 0) {
zend_op *last_op = &CG(active_op_array)->opcodes[last_op_number-1];
switch (last_op->opcode) {
case ZEND_FETCH_OBJ_RW:
last_op->opcode = op;
@ -360,8 +360,8 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
zend_op *opline_ptr;
zend_llist *fetch_list_ptr;
if (varname->op_type == IS_CONST &&
(Z_TYPE(varname->u.constant) == IS_STRING ||
if (varname->op_type == IS_CONST &&
(Z_TYPE(varname->u.constant) == IS_STRING ||
Z_TYPE(varname->u.constant) == IS_UNICODE) &&
!zend_u_is_auto_global(Z_TYPE(varname->u.constant), Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant) TSRMLS_CC) &&
!(Z_UNILEN(varname->u.constant) == (sizeof("this")-1) &&
@ -390,7 +390,7 @@ void fetch_simple_variable_ex(znode *result, znode *varname, int bp, zend_uchar
SET_UNUSED(opline_ptr->op2);
opline_ptr->op2.u.EA.type = ZEND_FETCH_LOCAL;
if (varname->op_type == IS_CONST &&
if (varname->op_type == IS_CONST &&
(Z_TYPE(varname->u.constant) == IS_STRING ||
Z_TYPE(varname->u.constant) == IS_UNICODE)) {
if (zend_u_is_auto_global(Z_TYPE(varname->u.constant), Z_UNIVAL(varname->u.constant), Z_UNILEN(varname->u.constant) TSRMLS_CC)) {
@ -426,7 +426,7 @@ void zend_do_fetch_static_member(znode *result, znode *class_znode TSRMLS_DC)
opline.result.u.EA.type = 0;
opline.result.u.var = get_temporary_variable(CG(active_op_array));
opline.op1.op_type = IS_CONST;
ZVAL_TEXTL(&opline.op1.u.constant,
ZVAL_TEXTL(&opline.op1.u.constant,
CG(active_op_array)->vars[result->u.var].name,
CG(active_op_array)->vars[result->u.var].name_len, 1);
SET_UNUSED(opline.op2);
@ -524,7 +524,7 @@ void zend_do_abstract_method(znode *function_name, znode *modifiers, znode *body
char *method_type;
if (CG(active_class_entry)->ce_flags & ZEND_ACC_INTERFACE) {
Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
Z_LVAL(modifiers->u.constant) |= ZEND_ACC_ABSTRACT;
method_type = "Interface";
} else {
method_type = "Abstract";
@ -555,7 +555,7 @@ static zend_bool opline_is_fetch_this(zend_op *opline TSRMLS_DC)
{
if ((opline->opcode == ZEND_FETCH_W) && (opline->op1.op_type == IS_CONST)
&& (Z_TYPE(opline->op1.u.constant) == IS_STRING ||
Z_TYPE(opline->op1.u.constant) == IS_UNICODE)
Z_TYPE(opline->op1.u.constant) == IS_UNICODE)
&& (Z_UNILEN(opline->op1.u.constant) == (sizeof("this")-1))
&& ZEND_U_EQUAL(Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), "this", sizeof("this")-1)) {
return 1;
@ -574,7 +574,7 @@ void zend_do_assign(znode *result, znode *variable, znode *value TSRMLS_DC)
while (last_op_number - n > 0) {
zend_op *last_op;
last_op = &CG(active_op_array)->opcodes[last_op_number-n-1];
if (last_op->result.op_type == IS_VAR &&
@ -648,7 +648,7 @@ void zend_do_assign_ref(znode *result, znode *lvar, znode *rvar TSRMLS_DC)
opline->opcode = ZEND_ASSIGN_REF;
if (zend_is_function_or_method_call(rvar)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@ -710,7 +710,7 @@ void zend_do_while_end(znode *while_token, znode *close_bracket_token TSRMLS_DC)
opline->op1.u.opline_num = while_token->u.opline_num;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
/* update while's conditional jmp */
CG(active_op_array)->opcodes[close_bracket_token->u.opline_num].op2.u.opline_num = get_next_op_number(CG(active_op_array));
@ -849,7 +849,7 @@ void zend_do_if_after_statement(znode *closing_bracket_token, unsigned char init
}
zend_stack_top(&CG(bp_stack), (void **) &jmp_list_ptr);
zend_llist_add_element(jmp_list_ptr, &if_end_op_number);
CG(active_op_array)->opcodes[closing_bracket_token->u.opline_num].op2.u.opline_num = if_end_op_number+1;
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
@ -903,7 +903,7 @@ void zend_do_end_variable_parse(int type, int arg_offset TSRMLS_DC)
le = fetch_list_ptr->head;
/* TODO: $foo->x->y->z = 1 should fetch "x" and "y" for R or RW, not just W */
if (le) {
opline_ptr = (zend_op *)le->data;
if (opline_is_fetch_this(opline_ptr TSRMLS_CC)) {
@ -1069,7 +1069,7 @@ void zend_do_free(znode *op1 TSRMLS_DC)
}
} else if (op1->op_type == IS_CONST) {
zval_dtor(&op1->u.constant);
}
}
}
@ -1213,11 +1213,11 @@ void zend_do_begin_function_declaration(znode *function_token, znode *function_n
SET_UNUSED(opline->op1);
SET_UNUSED(opline->op2);
}
{
/* Push a seperator to the switch and foreach stacks */
zend_switch_entry switch_entry;
switch_entry.cond.op_type = IS_UNUSED;
switch_entry.default_case = 0;
switch_entry.control_var = 0;
@ -1271,7 +1271,7 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
} else {
zend_uchar utype;
/* we don't care if the function name is longer, in fact lowercasing only
/* we don't care if the function name is longer, in fact lowercasing only
* the beginning of the name speeds up the check process */
if (UG(unicode)) {
utype = IS_UNICODE;
@ -1288,7 +1288,7 @@ void zend_do_end_function_declaration(znode *function_token TSRMLS_DC)
ZEND_U_EQUAL(utype, lcname, lcname_len, ZEND_AUTOLOAD_FUNC_NAME, sizeof(ZEND_AUTOLOAD_FUNC_NAME)-1) &&
CG(active_op_array)->num_args != 1) {
zend_error(E_COMPILE_ERROR, "%s() must take exactly 1 argument", ZEND_AUTOLOAD_FUNC_NAME);
}
}
if (lcname != lcname_buf) {
efree(lcname);
}
@ -1387,7 +1387,7 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC)
zend_function *function;
unsigned int lcname_len;
char *lcname;
lcname = zend_u_str_case_fold(Z_TYPE(function_name->u.constant), Z_UNIVAL(function_name->u.constant), Z_UNILEN(function_name->u.constant), 0, &lcname_len);
if (zend_u_hash_find(CG(function_table), Z_TYPE(function_name->u.constant), lcname, lcname_len+1, (void **) &function)==FAILURE) {
zend_do_begin_dynamic_function_call(function_name TSRMLS_CC);
@ -1401,22 +1401,22 @@ int zend_do_begin_function_call(znode *function_name TSRMLS_DC)
} else {
Z_STRVAL(function_name->u.constant) = lcname;
}
switch (function->type) {
case ZEND_USER_FUNCTION: {
zend_op_array *op_array = (zend_op_array *) function;
zend_stack_push(&CG(function_call_stack), (void *) &op_array, sizeof(zend_function *));
}
break;
case ZEND_INTERNAL_FUNCTION: {
zend_internal_function *internal_function = (zend_internal_function *) function;
zend_stack_push(&CG(function_call_stack), (void *) &internal_function, sizeof(zend_function *));
}
break;
}
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
return 0;
}
@ -1430,7 +1430,7 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
zend_do_end_variable_parse(BP_VAR_R, 0 TSRMLS_CC);
zend_do_begin_variable_parse(TSRMLS_C);
last_op_number = get_next_op_number(CG(active_op_array))-1;
last_op = &CG(active_op_array)->opcodes[last_op_number];
@ -1451,9 +1451,9 @@ void zend_do_begin_method_call(znode *left_bracket TSRMLS_DC)
}
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
}
void zend_do_clone(znode *result, znode *expr TSRMLS_DC)
{
@ -1481,7 +1481,7 @@ void zend_do_begin_dynamic_function_call(znode *function_name TSRMLS_DC)
SET_UNUSED(opline->op1);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(zend_function *));
zend_do_extended_fcall_begin(TSRMLS_C);
zend_do_extended_fcall_begin(TSRMLS_C);
}
@ -1585,7 +1585,7 @@ void zend_do_begin_class_member_function_call(znode *class_name, znode *method_n
void zend_do_end_function_call(znode *function_name, znode *result, znode *argument_list, int is_method, int is_dynamic_fcall TSRMLS_DC)
{
zend_op *opline;
if (is_method && function_name && function_name->op_type == IS_UNUSED) {
/* clone */
if (Z_LVAL(argument_list->u.constant) != 0) {
@ -1602,7 +1602,7 @@ void zend_do_end_function_call(znode *function_name, znode *result, znode *argum
SET_UNUSED(opline->op1);
}
}
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->result.op_type = IS_VAR;
*result = opline->result;
@ -1620,7 +1620,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
zend_function **function_ptr_ptr, *function_ptr;
int send_by_reference;
int send_function = 0;
zend_stack_top(&CG(function_call_stack), (void **) &function_ptr_ptr);
function_ptr = *function_ptr_ptr;
@ -1641,7 +1641,7 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
op = (param->op_type & (IS_VAR|IS_CV))?ZEND_SEND_REF:ZEND_SEND_VAL;
send_by_reference = 0;
} else {
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
send_by_reference = ARG_SHOULD_BE_SENT_BY_REF(function_ptr, (zend_uint) offset) ? ZEND_ARG_SEND_BY_REF : 0;
}
} else {
send_by_reference = 0;
@ -1711,11 +1711,11 @@ void zend_do_pass_param(znode *param, zend_uchar op, int offset TSRMLS_DC)
static int generate_free_switch_expr(zend_switch_entry *switch_entry TSRMLS_DC)
{
zend_op *opline;
if (switch_entry->cond.op_type != IS_VAR && switch_entry->cond.op_type != IS_TMP_VAR) {
return (switch_entry->cond.op_type == IS_UNUSED);
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_SWITCH_FREE;
@ -1732,7 +1732,7 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
/* If we reach the seperator then stop applying the stack */
if (foreach_copy->result.op_type == IS_UNUSED && foreach_copy->op1.op_type == IS_UNUSED) {
return 1;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
@ -1749,14 +1749,14 @@ static int generate_free_foreach_copy(zend_op *foreach_copy TSRMLS_DC)
SET_UNUSED(opline->op2);
opline->extended_value = 0;
}
return 0;
}
void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
{
zend_op *opline;
if (do_end_vparse) {
if (CG(active_op_array)->return_reference && !zend_is_function_or_method_call(expr)) {
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
@ -1776,7 +1776,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_RETURN;
if (expr) {
opline->op1 = *expr;
} else {
@ -1786,7 +1786,7 @@ void zend_do_return(znode *expr, int do_end_vparse TSRMLS_DC)
if (do_end_vparse) {
if (zend_is_function_or_method_call(expr)) {
opline->extended_value = ZEND_RETURNS_FUNCTION;
opline->extended_value = ZEND_RETURNS_FUNCTION;
} else {
opline->extended_value = 0;
}
@ -1845,7 +1845,7 @@ void zend_do_begin_catch(znode *try_token, znode *catch_class, znode *catch_var,
{
long catch_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
if (catch_op_number > 0) {
opline = &CG(active_op_array)->opcodes[catch_op_number-1];
if (opline->opcode == ZEND_FETCH_CLASS) {
@ -1871,7 +1871,7 @@ void zend_do_end_catch(znode *try_token TSRMLS_DC)
void zend_do_throw(znode *expr TSRMLS_DC)
{
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_THROW;
opline->op1 = *expr;
@ -1952,7 +1952,7 @@ static void do_inherit_parent_constructor(zend_class_entry *ce TSRMLS_DC)
}
return;
}
if (zend_hash_find(&ce->parent->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), (void **)&function)==SUCCESS) {
/* inherit parent's constructor */
zend_hash_update(&ce->function_table, ZEND_CONSTRUCTOR_FUNC_NAME, sizeof(ZEND_CONSTRUCTOR_FUNC_NAME), function, sizeof(zend_function), NULL);
@ -2083,7 +2083,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
if (parent->common.fn_flags & ZEND_ACC_ABSTRACT
&& parent->common.scope != (child->common.prototype ? child->common.prototype->common.scope : child->common.scope)
&& child->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_IMPLEMENTED_ABSTRACT)) {
zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %v::%v() (previously declared abstract in %v)",
zend_error(E_COMPILE_ERROR, "Can't inherit abstract function %v::%v() (previously declared abstract in %v)",
parent->common.scope->name,
child->common.function_name,
child->common.prototype ? child->common.prototype->common.scope->name : child->common.scope->name);
@ -2116,7 +2116,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
*/
if ((child_flags & ZEND_ACC_PPP_MASK) > (parent_flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %v::%v() must be %s (as in class %v)%s", ZEND_FN_SCOPE_NAME(child), child->common.function_name, zend_visibility_string(parent_flags), ZEND_FN_SCOPE_NAME(parent), (parent_flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
} else if (((child_flags & ZEND_ACC_PPP_MASK) < (parent_flags & ZEND_ACC_PPP_MASK))
&& ((parent_flags & ZEND_ACC_PPP_MASK) & ZEND_ACC_PRIVATE)) {
child->common.fn_flags |= ZEND_ACC_CHANGED;
}
@ -2129,7 +2129,7 @@ static zend_bool do_inherit_method_check(HashTable *child_function_table, zend_f
child->common.prototype = parent->common.prototype;
}
if (child->common.prototype) {
if (!zend_do_perform_implementation_check(child, child->common.prototype)) {
zend_error(E_COMPILE_ERROR, "Declaration of %v::%v() must be compatible with that of %v::%v()", ZEND_FN_SCOPE_NAME(child), child->common.function_name, ZEND_FN_SCOPE_NAME(child->common.prototype), child->common.prototype->common.function_name);
@ -2150,7 +2150,7 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
zend_class_entry *parent_ce = ce->parent;
zend_uchar utype;
TSRMLS_FETCH();
utype = UG(unicode)?IS_UNICODE:IS_STRING;
if (parent_info->flags & (ZEND_ACC_PRIVATE|ZEND_ACC_SHADOW)) {
if (zend_u_hash_quick_find(&ce->properties_info, hash_key->type, hash_key->u.string, hash_key->nKeyLength, hash_key->h, (void **) &child_info)==SUCCESS) {
@ -2172,20 +2172,20 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if ((parent_info->flags & ZEND_ACC_STATIC) != (child_info->flags & ZEND_ACC_STATIC)) {
zend_error(E_COMPILE_ERROR, "Cannot redeclare %s%v::$%R as %s%v::$%R",
(parent_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", parent_ce->name, hash_key->type, hash_key->u.string,
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->type, hash_key->u.string);
(child_info->flags & ZEND_ACC_STATIC) ? "static " : "non static ", ce->name, hash_key->type, hash_key->u.string);
}
if(parent_info->flags & ZEND_ACC_CHANGED) {
child_info->flags |= ZEND_ACC_CHANGED;
}
if ((child_info->flags & ZEND_ACC_PPP_MASK) > (parent_info->flags & ZEND_ACC_PPP_MASK)) {
zend_error(E_COMPILE_ERROR, "Access level to %v::$%R must be %s (as in class %v)%s", ce->name, hash_key->type, hash_key->u.string, zend_visibility_string(parent_info->flags), parent_ce->name, (parent_info->flags&ZEND_ACC_PUBLIC) ? "" : " or weaker");
} else if (child_info->flags & ZEND_ACC_IMPLICIT_PUBLIC) {
if (!(parent_info->flags & ZEND_ACC_IMPLICIT_PUBLIC)) {
/* Explicitly copy the default value from the parent (if it has one) */
zval **pvalue;
if (zend_u_hash_quick_find(&parent_ce->default_properties, utype, parent_info->name, parent_info->name_length+1, parent_info->h, (void **) &pvalue) == SUCCESS) {
(*pvalue)->refcount++;
zend_u_hash_del(&ce->default_properties, utype, child_info->name, child_info->name_length+1);
@ -2214,8 +2214,8 @@ static zend_bool do_inherit_property_access_check(HashTable *target_ht, zend_pro
if (Z_TYPE_PP(new_prop) != IS_NULL && Z_TYPE_PP(prop) != IS_NULL) {
char *prop_name, *tmp;
zend_u_unmangle_property_name(utype, child_info->name, &tmp, &prop_name);
zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %v::$%v in class %v",
zend_u_unmangle_property_name(utype, child_info->name, &tmp, &prop_name);
zend_error(E_COMPILE_ERROR, "Cannot change initial value of property static protected %v::$%v in class %v",
parent_ce->name, prop_name, ce->name);
}
}
@ -2336,7 +2336,7 @@ static zend_bool do_inherit_constant_check(HashTable *child_constants_table, zva
if (*old_constant != *parent_constant) {
zend_error(E_COMPILE_ERROR, "Cannot inherit previously-inherited constant %R from interface %v", hash_key->type, hash_key->u.string, iface->name);
}
return 0;
return 0;
}
return 1;
}
@ -2386,7 +2386,7 @@ ZEND_API int do_bind_function(zend_op *opline, HashTable *function_table, zend_b
return SUCCESS;
}
}
ZEND_API zend_class_entry *do_bind_class(zend_op *opline, HashTable *class_table, zend_bool compile_time TSRMLS_DC)
{
@ -2565,7 +2565,7 @@ void zend_do_boolean_or_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@ -2600,7 +2600,7 @@ void zend_do_boolean_and_begin(znode *expr1, znode *op_token TSRMLS_DC)
}
opline->op1 = *expr1;
SET_UNUSED(opline->op2);
op_token->u.opline_num = next_op_number;
*expr1 = opline->result;
@ -2686,7 +2686,7 @@ void zend_do_switch_end(znode *case_list TSRMLS_DC)
{
zend_op *opline;
zend_switch_entry *switch_entry_ptr;
zend_stack_top(&CG(switch_cond_stack), (void **) &switch_entry_ptr);
/* add code to jmp to default case */
@ -2746,7 +2746,7 @@ void zend_do_case_before_statement(znode *case_list, znode *case_token, znode *c
zval_copy_ctor(&opline->op1.u.constant);
}
result = opline->result;
next_op_number = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@ -2854,11 +2854,11 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->op1.op_type = IS_CONST;
build_runtime_defined_function_key(&opline->op1.u.constant, Z_TYPE(class_name->u.constant), lcname, lcname_len TSRMLS_CC);
opline->op2.op_type = IS_CONST;
Z_TYPE(opline->op2.u.constant) = Z_TYPE(class_name->u.constant);
opline->op2.u.constant.refcount = 1;
if (doing_inheritance) {
opline->extended_value = parent_class_name->u.var;
opline->opcode = ZEND_DECLARE_INHERITED_CLASS;
@ -2873,7 +2873,7 @@ void zend_do_begin_class_declaration(znode *class_token, znode *class_name, znod
Z_STRVAL(opline->op2.u.constant) = lcname;
Z_STRLEN(opline->op2.u.constant) = lcname_len;
}
zend_u_hash_update(CG(class_table), Z_TYPE(opline->op1.u.constant), Z_UNIVAL(opline->op1.u.constant), Z_UNILEN(opline->op1.u.constant), &new_class_entry, sizeof(zend_class_entry *), NULL);
CG(active_class_entry) = new_class_entry;
@ -2963,7 +2963,7 @@ void zend_do_implements_interface(znode *interface_znode TSRMLS_DC)
}
break;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_ADD_INTERFACE;
opline->op1 = CG(implementing_class);
@ -2976,7 +2976,7 @@ ZEND_API void zend_mangle_property_name(char **dest, int *dest_length, char *src
{
char *prop_name;
int prop_name_length;
prop_name_length = 1 + src1_length + 1 + src2_length;
prop_name = pemalloc(prop_name_length + 1, internal);
prop_name[0] = '\0';
@ -3093,11 +3093,11 @@ void zend_do_declare_property(znode *var_name, znode *value, zend_uint access_ty
void zend_do_declare_class_constant(znode *var_name, znode *value TSRMLS_DC)
{
zval *property;
if(Z_TYPE(value->u.constant) == IS_CONSTANT_ARRAY) {
zend_error(E_COMPILE_ERROR, "Arrays are not allowed in class constants");
}
ALLOC_ZVAL(property);
if (value) {
@ -3121,9 +3121,9 @@ void zend_do_fetch_property(znode *result, znode *object, znode *property TSRMLS
zend_op opline;
zend_llist *fetch_list_ptr;
zend_op *opline_ptr=NULL;
zend_stack_top(&CG(bp_stack), (void **) &fetch_list_ptr);
if (fetch_list_ptr->count == 1) {
zend_llist_element *le;
@ -3234,7 +3234,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
{
zend_op *opline;
unsigned char *ptr = NULL;
new_token->u.opline_num = get_next_op_number(CG(active_op_array));
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_NEW;
@ -3242,7 +3242,7 @@ void zend_do_begin_new_object(znode *new_token, znode *class_type TSRMLS_DC)
opline->result.u.var = get_temporary_variable(CG(active_op_array));
opline->op1 = *class_type;
SET_UNUSED(opline->op2);
zend_stack_push(&CG(function_call_stack), (void *) &ptr, sizeof(unsigned char *));
}
@ -3273,7 +3273,7 @@ void zend_do_fetch_constant(znode *result, znode *constant_container, znode *con
case ZEND_RT:
{
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_FETCH_CONSTANT;
opline->result.op_type = IS_TMP_VAR;
opline->result.u.var = get_temporary_variable(CG(active_op_array));
@ -3389,7 +3389,7 @@ void zend_do_add_static_array_element(znode *result, znode *offset, znode *expr)
zend_symtable_update(Z_ARRVAL(result->u.constant), "", 1, &element, sizeof(zval *), NULL);
break;
case IS_LONG:
case IS_BOOL:
case IS_BOOL:
zend_hash_index_update(Z_ARRVAL(result->u.constant), Z_LVAL(offset->u.constant), &element, sizeof(zval *), NULL);
break;
case IS_DOUBLE:
@ -3656,7 +3656,7 @@ void zend_do_unset(znode *variable TSRMLS_DC)
break;
}
}
}
}
@ -3667,7 +3667,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
zend_do_end_variable_parse(BP_VAR_IS, 0 TSRMLS_CC);
zend_check_writable_variable(variable);
if (variable->op_type == IS_CV) {
last_op = get_next_op(CG(active_op_array) TSRMLS_CC);
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@ -3680,7 +3680,7 @@ void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC
last_op->result.u.var = get_temporary_variable(CG(active_op_array));
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
switch (last_op->opcode) {
case ZEND_FETCH_IS:
last_op->opcode = ZEND_ISSET_ISEMPTY_VAR;
@ -3711,7 +3711,7 @@ void zend_do_instanceof(znode *result, znode *expr, znode *class_znode, int type
opline->extended_value |= ZEND_FETCH_CLASS_NO_AUTOLOAD;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_INSTANCEOF;
opline->result.op_type = IS_TMP_VAR;
@ -3783,7 +3783,7 @@ void zend_do_foreach_begin(znode *foreach_token, znode *open_brackets_token, zno
void zend_do_foreach_fetch(znode *foreach_token, znode *open_brackets_token, znode *as_token TSRMLS_DC)
{
zend_op *opline;
/* save the location of FE_FETCH */
as_token->u.opline_num = get_next_op_number(CG(active_op_array));
@ -3837,7 +3837,7 @@ void zend_do_foreach_cont(znode *foreach_token, znode *as_token, znode *value, z
}
value_node = opline->result;
zend_do_end_variable_parse(BP_VAR_W, 0 TSRMLS_CC);
if (assign_by_ref) {
/* Mark FE_FETCH as IS_VAR as it holds the data directly as a value */
@ -3958,14 +3958,14 @@ void zend_do_end_heredoc(TSRMLS_D)
if (Z_USTRVAL(opline->op2.u.constant)[Z_USTRLEN(opline->op2.u.constant)-1]=='\r') {
Z_USTRVAL(opline->op2.u.constant)[(Z_USTRLEN(opline->op2.u.constant)--)-1] = 0;
}
}
}
} else {
Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0;
if (Z_STRLEN(opline->op2.u.constant)>0) {
if (Z_STRVAL(opline->op2.u.constant)[Z_STRLEN(opline->op2.u.constant)-1]=='\r') {
Z_STRVAL(opline->op2.u.constant)[(Z_STRLEN(opline->op2.u.constant)--)-1] = 0;
}
}
}
}
}
@ -4010,7 +4010,7 @@ void zend_do_begin_qm_op(znode *cond, znode *qm_token TSRMLS_DC)
{
int jmpz_op_number = get_next_op_number(CG(active_op_array));
zend_op *opline;
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_JMPZ;
@ -4053,7 +4053,7 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
opline->result = *qm_token;
opline->op1 = *false_value;
SET_UNUSED(opline->op2);
CG(active_op_array)->opcodes[colon_token->u.opline_num].op1.u.opline_num = get_next_op_number(CG(active_op_array));
*result = opline->result;
@ -4065,11 +4065,11 @@ void zend_do_qm_false(znode *result, znode *false_value, znode *qm_token, znode
void zend_do_extended_info(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_STMT;
@ -4081,11 +4081,11 @@ void zend_do_extended_info(TSRMLS_D)
void zend_do_extended_fcall_begin(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_BEGIN;
@ -4097,11 +4097,11 @@ void zend_do_extended_fcall_begin(TSRMLS_D)
void zend_do_extended_fcall_end(TSRMLS_D)
{
zend_op *opline;
if (!CG(extended_info)) {
return;
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_EXT_FCALL_END;
@ -4192,7 +4192,7 @@ again:
efree(Z_STRVAL(zendlval->u.constant));
break;
}
INIT_PZVAL(&zendlval->u.constant);
zendlval->op_type = IS_CONST;
return retval;
@ -4266,7 +4266,7 @@ int zend_get_class_fetch_type(zend_uchar type, char *class_name, uint class_name
{
if ((class_name_len == sizeof("self")-1) &&
ZEND_U_EQUAL(type, class_name, class_name_len, "self", sizeof("self")-1)) {
return ZEND_FETCH_CLASS_SELF;
return ZEND_FETCH_CLASS_SELF;
} else if ((class_name_len == sizeof("parent")-1) &&
ZEND_U_EQUAL(type, class_name, class_name_len, "parent", sizeof("parent")-1)) {
return ZEND_FETCH_CLASS_PARENT;
@ -4286,11 +4286,11 @@ ZEND_API char* zend_get_compiled_variable_name(zend_op_array *op_array, zend_uin
void zend_do_normalization(znode *result, znode *str TSRMLS_DC)
{
zend_op *opline;
if (!UG(unicode)) {
*result = *str;
return;
}
}
opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_U_NORMALIZE;
opline->result.op_type = IS_TMP_VAR;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -173,7 +173,7 @@ typedef struct _zend_compiled_variable {
struct _zend_op_array {
/* Common elements */
zend_uchar type;
char *function_name;
char *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
union _zend_function *prototype;
@ -227,9 +227,9 @@ struct _zend_op_array {
typedef struct _zend_internal_function {
/* Common elements */
zend_uchar type;
char *function_name;
char *function_name;
zend_class_entry *scope;
zend_uint fn_flags;
zend_uint fn_flags;
union _zend_function *prototype;
zend_uint num_args;
zend_uint required_num_args;
@ -259,7 +259,7 @@ typedef union _zend_function {
zend_bool pass_rest_by_reference;
unsigned char return_reference;
} common;
zend_op_array op_array;
zend_internal_function internal_function;
} zend_function;
@ -518,7 +518,7 @@ void zend_do_normalization(znode *result, znode *str TSRMLS_DC);
/* helper functions in zend_language_scanner.l */
ZEND_API zend_op_array *compile_file(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_string(zval *source_string, char *filename TSRMLS_DC);
ZEND_API zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC);
ZEND_API int zend_execute_scripts(int type TSRMLS_DC, zval **retval, int file_count, ...);
ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC);

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -64,7 +64,7 @@ typedef unsigned int uint;
/* This will cause the compilation process to be MUCH longer, but will generate
* a much quicker PHP binary
*/
/*
/*
#undef inline
#ifdef ZEND_WIN32_FORCE_INLINE
# define inline __forceinline

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -87,7 +87,7 @@ typedef unsigned int uint;
#define ZEND_DLEXPORT __declspec(dllexport)
#define ZEND_DLIMPORT __declspec(dllimport)
/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
/* 0x00200000L is MB_SERVICE_NOTIFICATION, which is only supported under Windows NT
* (and requires _WIN32_WINNT to be defined, which prevents the resulting executable
* from running under Windows 9x
* Windows 9x should silently ignore it, so it's being used here directly

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -117,7 +117,7 @@ void zend_register_standard_constants(TSRMLS_D)
/* true/false constants */
{
zend_constant c;
Z_TYPE(c.value) = IS_BOOL;
c.flags = CONST_PERSISTENT;
c.module_number = 0;
@ -127,7 +127,7 @@ void zend_register_standard_constants(TSRMLS_D)
Z_LVAL(c.value) = 1;
Z_TYPE(c.value) = IS_BOOL;
zend_register_constant(&c TSRMLS_CC);
c.name = zend_strndup(ZEND_STRL("FALSE"));
c.name_len = sizeof("FALSE");
Z_LVAL(c.value) = 0;
@ -169,7 +169,7 @@ void clean_non_persistent_constants(TSRMLS_D)
ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
Z_TYPE(c.value) = IS_LONG;
Z_LVAL(c.value) = lval;
c.flags = flags;
@ -183,7 +183,7 @@ ZEND_API void zend_register_long_constant(char *name, uint name_len, long lval,
ZEND_API void zend_register_double_constant(char *name, uint name_len, double dval, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
Z_TYPE(c.value) = IS_DOUBLE;
Z_DVAL(c.value) = dval;
c.flags = flags;
@ -197,7 +197,7 @@ ZEND_API void zend_register_double_constant(char *name, uint name_len, double dv
ZEND_API void zend_register_stringl_constant(char *name, uint name_len, char *strval, uint strlen, int flags, int module_number TSRMLS_DC)
{
zend_constant c;
Z_TYPE(c.value) = IS_STRING;
Z_STRVAL(c.value) = strval;
Z_STRLEN(c.value) = strlen;
@ -237,7 +237,7 @@ ZEND_API int zend_u_get_constant(zend_uchar type, void *name, uint name_len, zva
} else {
scope = CG(active_class_entry);
}
if (UG(unicode)) {
class_name = (char*)eustrndup((UChar*)name, class_name_len);
} else {
@ -252,12 +252,12 @@ ZEND_API int zend_u_get_constant(zend_uchar type, void *name, uint name_len, zva
zend_error(E_ERROR, "Cannot access self:: when no class scope is active");
retval = 0;
}
} else if (class_name_len == sizeof("parent")-1 &&
} else if (class_name_len == sizeof("parent")-1 &&
ZEND_U_EQUAL(type, class_name, class_name_len, "parent", sizeof("parent")-1)) {
if (!scope) {
if (!scope) {
zend_error(E_ERROR, "Cannot access parent:: when no class scope is active");
} else if (!scope->parent) {
zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
} else if (!scope->parent) {
zend_error(E_ERROR, "Cannot access parent:: when current class scope has no parent");
} else {
ce = &scope->parent;
}
@ -281,15 +281,15 @@ ZEND_API int zend_u_get_constant(zend_uchar type, void *name, uint name_len, zva
*result = **ret_constant;
zval_copy_ctor(result);
}
return retval;
}
if (zend_u_hash_find(EG(zend_constants), type, name, name_len+1, (void **) &c) == FAILURE) {
unsigned int lookup_name_len;
lookup_name = zend_u_str_case_fold(type, name, name_len, 1, &lookup_name_len);
if (zend_u_hash_find(EG(zend_constants), type, lookup_name, lookup_name_len+1, (void **) &c)==SUCCESS) {
if ((c->flags & CONST_CS) && memcmp(c->name, name, UG(unicode)?UBYTES(name_len):name_len)!=0) {
retval=0;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -144,7 +144,7 @@ ZEND_METHOD(exception, __construct)
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
@ -183,7 +183,7 @@ ZEND_METHOD(error_exception, __construct)
UErrorCode status = U_ZERO_ERROR;
UChar *u_str;
int32_t u_len;
zend_convert_to_unicode(ZEND_U_CONVERTER(UG(runtime_encoding_conv)), &u_str, &u_len, message, message_len, &status);
zend_update_property_unicodel(default_exception_ce, object, "message", sizeof("message")-1, u_str, u_len TSRMLS_CC);
efree(u_str);
@ -197,11 +197,11 @@ ZEND_METHOD(error_exception, __construct)
}
zend_update_property_long(default_exception_ce, object, "severity", sizeof("severity")-1, severity TSRMLS_CC);
if (argc >= 4) {
if (file_type == IS_UNICODE) {
zend_update_property_unicodel(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
} else {
} else {
zend_update_property_stringl(default_exception_ce, object, "file", sizeof("file")-1, filename, filename_len TSRMLS_CC);
}
if (argc < 5) {
@ -460,7 +460,7 @@ static int _build_trace_args(zval **arg, int num_args, va_list args, zend_hash_k
if(!dup) {
efree(class_name);
}
TRACE_APPEND_STR("), ");
break;
}
@ -523,7 +523,7 @@ ZEND_METHOD(exception, getTraceAsString)
zval *trace;
char *res = estrdup(""), **str = &res, *s_tmp;
int res_len = 0, *len = &res_len, num = 0;
trace = zend_read_property(default_exception_ce, getThis(), "trace", sizeof("trace")-1, 1 TSRMLS_CC);
zend_hash_apply_with_arguments(Z_ARRVAL_P(trace), (apply_func_args_t)_build_trace_string, 3, str, len, &num);
@ -532,8 +532,8 @@ ZEND_METHOD(exception, getTraceAsString)
TRACE_APPEND_STRL(s_tmp, strlen(s_tmp));
efree(s_tmp);
res[res_len] = '\0';
RETURN_STRINGL(res, res_len, 0);
res[res_len] = '\0';
RETURN_STRINGL(res, res_len, 0);
}
/* }}} */
@ -542,7 +542,7 @@ int zend_spprintf(char **message, int max_len, char *format, ...)
va_list arg;
int len;
va_start(arg, format);
va_start(arg, format);
len = zend_vspprintf(message, max_len, format, arg);
va_end(arg);
return len;
@ -585,12 +585,12 @@ ZEND_METHOD(exception, __toString)
}
if (Z_UNILEN(message) > 0) {
len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
len = zend_spprintf(&str, 0, "exception '%v' with message '%R' in %R:%ld\nStack trace:\n%s",
Z_OBJCE_P(getThis())->name, Z_TYPE(message), Z_UNIVAL(message), Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
} else {
len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
len = zend_spprintf(&str, 0, "exception '%v' in %R:%ld\nStack trace:\n%s",
Z_OBJCE_P(getThis())->name, Z_TYPE(file), Z_UNIVAL(file), Z_LVAL(line),
(trace && Z_STRLEN_P(trace)) ? Z_STRVAL_P(trace) : "#0 {main}\n");
}
@ -612,9 +612,9 @@ ZEND_METHOD(exception, __toString)
/* All functions that may be used in uncaught exception handlers must be final
* and must not throw exceptions. Otherwise we would need a facility to handle
* such exceptions in that handler.
* such exceptions in that handler.
* Also all getXY() methods are final because thy serve as read only access to
* their corresponding properties, no more, no less. If after all you need to
* their corresponding properties, no more, no less. If after all you need to
* override somthing then it is method __toString().
* And never try to change the state of exceptions and never implement anything
* that gives the user anything to accomplish this.
@ -659,7 +659,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "Exception", default_exception_functions);
default_exception_ce = zend_register_internal_class(&ce TSRMLS_CC);
default_exception_ce->create_object = zend_default_exception_new;
default_exception_ce->create_object = zend_default_exception_new;
memcpy(&default_exception_handlers, zend_get_std_object_handlers(), sizeof(zend_object_handlers));
default_exception_handlers.clone_obj = NULL;
@ -672,7 +672,7 @@ void zend_register_default_exception(TSRMLS_D)
INIT_CLASS_ENTRY(ce, "ErrorException", error_exception_functions);
error_exception_ce = zend_register_internal_class_ex(&ce, default_exception_ce, NULL TSRMLS_CC);
error_exception_ce->create_object = zend_error_exception_new;
error_exception_ce->create_object = zend_error_exception_new;
zend_declare_property_long(error_exception_ce, "severity", sizeof("severity")-1, E_ERROR, ZEND_ACC_PROTECTED TSRMLS_CC);
}
@ -701,7 +701,7 @@ ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *messa
exception_ce = default_exception_ce;
}
object_init_ex(ex, exception_ce);
if (message) {
zend_update_property_rt_string(default_exception_ce, ex, "message", sizeof("message")-1, message TSRMLS_CC);
@ -721,7 +721,7 @@ ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long cod
char *message;
zval *zexception;
va_start(arg, format);
va_start(arg, format);
zend_vspprintf(&message, 0, format, arg);
va_end(arg);
zexception = zend_throw_exception(exception_ce, message, code TSRMLS_CC);
@ -740,7 +740,7 @@ ZEND_API zval * zend_throw_error_exception(zend_class_entry *exception_ce, char
static void zend_error_va(int type, const char *file, uint lineno, const char *format, ...)
{
va_list args;
va_start(args, format);
zend_error_cb(type, file, lineno, format, args);
va_end(args);
@ -754,7 +754,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
zval *str, *file, *line;
EG(exception) = NULL;
zend_call_method_with_0_params(&exception, ce_exception, NULL, "__tostring", &str);
if (!EG(exception)) {
if (Z_TYPE_P(str) != IS_STRING) {
@ -764,7 +764,7 @@ ZEND_API void zend_exception_error(zval *exception TSRMLS_DC)
}
}
zval_ptr_dtor(&str);
if (EG(exception)) {
/* do the best we can to inform about the inner exception */
if (instanceof_function(ce_exception, default_exception_ce TSRMLS_CC)) {

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -34,7 +34,7 @@ ZEND_API zend_class_entry *zend_exception_get_default(TSRMLS_D);
ZEND_API zend_class_entry *zend_get_error_exception(TSRMLS_D);
ZEND_API void zend_register_default_classes(TSRMLS_D);
/* exception_ce NULL or zend_exception_get_default() or a derived class
/* exception_ce NULL or zend_exception_get_default() or a derived class
* message NULL or the message of the exception */
ZEND_API zval * zend_throw_exception(zend_class_entry *exception_ce, char *message, long code TSRMLS_DC);
ZEND_API zval * zend_throw_exception_ex(zend_class_entry *exception_ce, long code TSRMLS_DC, char *format, ...);

View File

@ -127,7 +127,7 @@ static inline void zend_pzval_unlock_free_func(zval *z)
(z)->value = (v)->value; \
Z_TYPE_P(z) = Z_TYPE_P(v); \
(z)->refcount = 1; \
(z)->is_ref = 0;
(z)->is_ref = 0;
#define MAKE_REAL_ZVAL_PTR(val) \
do { \
@ -153,7 +153,7 @@ ZEND_API zval** zend_get_compiled_variable_value(zend_execute_data *execute_data
static inline void zend_get_cv_address(zend_uchar utype, zend_compiled_variable *cv, zval ***ptr, temp_variable *Ts TSRMLS_DC)
{
zval *new_zval = &EG(uninitialized_zval);
new_zval->refcount++;
zend_u_hash_quick_update(EG(active_symbol_table), utype, cv->name, cv->name_len+1, cv->hash_value, &new_zval, sizeof(zval *), (void **)ptr);
}
@ -219,7 +219,7 @@ static inline zval *_get_zval_ptr_var(znode *node, temp_variable *Ts, zend_free_
static inline zval *_get_zval_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
@ -289,7 +289,7 @@ static inline zval **_get_zval_ptr_ptr_var(znode *node, temp_variable *Ts, zend_
static inline zval **_get_zval_ptr_ptr_cv(znode *node, temp_variable *Ts, int type TSRMLS_DC)
{
zval ***ptr = &CV_OF(node->u.var);
if (!*ptr) {
zend_compiled_variable *cv = &CV_DEF_OF(node->u.var);
zend_uchar utype = UG(unicode)?IS_UNICODE:IS_STRING;
@ -534,7 +534,7 @@ static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zv
if (!arg) {
if (ptr && ptr->op_array) {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
} else {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array", arg_num, fclass, fsep, fname);
}
}
@ -550,7 +550,7 @@ static inline void zend_verify_arg_type(zend_function *zf, zend_uint arg_num, zv
break;
case IS_ARRAY:
break;
default:
default:
if (ptr && ptr->op_array) {
zend_error(E_RECOVERABLE_ERROR, "Argument %d passed to %v%s%v() must be an array, called in %s on line %d and defined", arg_num, fclass, fsep, fname, ptr->op_array->filename, ptr->opline->lineno);
} else {
@ -582,7 +582,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
make_real_object(object_ptr TSRMLS_CC); /* this should modify object only if it's empty */
object = *object_ptr;
if (Z_TYPE_P(object) != IS_OBJECT || (opcode == ZEND_ASSIGN_OBJ && !Z_OBJ_HT_P(object)->write_property)) {
zend_error(E_WARNING, "Attempt to assign property of non-object");
FREE_OP(free_op2);
@ -593,7 +593,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
FREE_OP(free_value);
return;
}
/* here we are sure we are dealing with an object */
/* separate our value if necessary */
@ -602,7 +602,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
char *class_name;
zend_uint class_name_len;
int dup;
ALLOC_ZVAL(value);
*value = *orig_value;
value->is_ref = 0;
@ -611,7 +611,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
}
zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name);
zend_error(E_STRICT, "Implicit cloning object of class '%v' because of 'zend.ze1_compatibility_mode'", class_name);
Z_OBJVAL_P(value) = Z_OBJ_HANDLER_P(orig_value, clone_obj)(orig_value TSRMLS_CC);
if (!dup) {
efree(class_name);
@ -632,7 +632,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
value->refcount = 0;
zval_copy_ctor(value);
}
value->refcount++;
if (opcode == ZEND_ASSIGN_OBJ) {
@ -650,7 +650,7 @@ static inline void zend_assign_to_object(znode *result, zval **object_ptr, znode
}
Z_OBJ_HT_P(object)->write_dimension(object, property_name, value TSRMLS_CC);
}
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr = value;
T(result->u.var).var.ptr_ptr = &T(result->u.var).var.ptr; /* this is so that we could use it in FETCH_DIM_R, etc. - see bug #27876 */
@ -671,7 +671,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
zend_free_op free_op1;
zval **variable_ptr_ptr = get_zval_ptr_ptr(op1, Ts, &free_op1, BP_VAR_W);
zval *variable_ptr;
if (!variable_ptr_ptr) {
temp_variable *T = &T(op1->u.var);
@ -714,7 +714,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
Z_STRVAL_P(T->str_offset.str)[T->str_offset.offset] = Z_STRVAL_P(final_value)[0];
if (op2->op_type == IS_TMP_VAR) {
if (final_value == &T(op2->u.var).tmp_var) {
/* we can safely free final_value here
@ -779,7 +779,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
} while (0);
/* zval_ptr_dtor(&T->str_offset.str); Nuke this line if it doesn't cause a leak */
/* T(result->u.var).var.ptr_ptr = &EG(uninitialized_zval_ptr); */
if (!RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = &value;
@ -810,14 +810,14 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
Z_OBJ_HANDLER_P(variable_ptr, set)(variable_ptr_ptr, value TSRMLS_CC);
goto done_setting_var;
}
if (EG(ze1_compatibility_mode) && Z_TYPE_P(value) == IS_OBJECT) {
char *class_name;
zend_uint class_name_len;
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
} else if (PZVAL_IS_REF(variable_ptr)) {
@ -863,7 +863,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
if (variable_ptr!=value) {
zend_uint refcount = variable_ptr->refcount;
zval garbage;
if (type!=IS_TMP_VAR) {
value->refcount++;
}
@ -889,7 +889,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
variable_ptr->refcount++;
} else if (PZVAL_IS_REF(value)) {
zval tmp;
tmp = *value;
zval_copy_ctor(&tmp);
tmp.refcount=1;
@ -936,13 +936,13 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
}
(*variable_ptr_ptr)->is_ref=0;
}
done_setting_var:
if (result && !RETURN_VALUE_UNUSED(result)) {
T(result->u.var).var.ptr_ptr = variable_ptr_ptr;
PZVAL_LOCK(*variable_ptr_ptr);
AI_USE_PTR(T(result->u.var).var);
}
}
FREE_OP_VAR_PTR(free_op1);
}
@ -957,7 +957,7 @@ static inline void zend_receive(zval **variable_ptr_ptr, zval *value TSRMLS_DC)
int dup;
dup = zend_get_object_classname(value, &class_name, &class_name_len TSRMLS_CC);
if (Z_OBJ_HANDLER_P(value, clone_obj) == NULL) {
zend_error_noreturn(E_ERROR, "Trying to clone an uncloneable object of class %v", class_name);
} else {
@ -1042,10 +1042,10 @@ static inline zval **zend_fetch_dimension_address_inner(HashTable *ht, zval *dim
goto fetch_string_dim;
case IS_STRING:
case IS_UNICODE:
offset_key = Z_UNIVAL_P(dim);
offset_key_length = Z_UNILEN_P(dim)+1;
fetch_string_dim:
if (UG(unicode) && ht == &EG(symbol_table) && ztype == IS_UNICODE) {
/* Identifier normalization */
@ -1089,7 +1089,7 @@ fetch_string_dim:
zend_error(E_STRICT, "Resource ID#%ld used as offset, casting to integer (%ld)", Z_LVAL_P(dim), Z_LVAL_P(dim));
/* Fall Through */
case IS_DOUBLE:
case IS_BOOL:
case IS_BOOL:
case IS_LONG: {
long index;
@ -1121,7 +1121,7 @@ fetch_string_dim:
}
}
break;
default:
default:
zend_error(E_WARNING, "Illegal offset type");
switch (type) {
case BP_VAR_R:
@ -1145,7 +1145,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
if (!container_ptr) {
zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
}
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
@ -1191,7 +1191,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
if (zend_hash_next_index_insert(Z_ARRVAL_P(container), &new_zval, sizeof(zval *), (void **) &retval) == FAILURE) {
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
retval = &EG(error_zval_ptr);
new_zval->refcount--;
new_zval->refcount--;
}
} else {
retval = zend_fetch_dimension_address_inner(Z_ARRVAL_P(container), dim, type TSRMLS_CC);
@ -1254,12 +1254,12 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
zend_error_noreturn(E_ERROR, "Cannot use object as array");
} else {
zval *overloaded_result;
if (dim_is_tmp_var) {
zval *orig = dim;
MAKE_REAL_ZVAL_PTR(dim);
ZVAL_NULL(orig);
}
}
overloaded_result = Z_OBJ_HT_P(container)->read_dimension(container, dim, type TSRMLS_CC);
if (overloaded_result) {
@ -1292,7 +1292,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
return;
}
break;
default: {
default: {
switch (type) {
case BP_VAR_UNSET:
zend_error(E_WARNING, "Cannot unset offset in a non-array variable");
@ -1323,7 +1323,7 @@ static void zend_fetch_dimension_address(temp_variable *result, zval **container
static void zend_fetch_property_address(temp_variable *result, zval **container_ptr, zval *prop_ptr, int type TSRMLS_DC)
{
zval *container;
container = *container_ptr;
if (container == EG(error_zval_ptr)) {
if (result) {
@ -1348,7 +1348,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
break;
}
}
if (Z_TYPE_P(container) != IS_OBJECT) {
if (result) {
if (type == BP_VAR_R || type == BP_VAR_IS) {
@ -1360,7 +1360,7 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
}
return;
}
if (Z_OBJ_HT_P(container)->get_property_ptr_ptr) {
zval **ptr_ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr TSRMLS_CC);
if (NULL == ptr_ptr) {
@ -1389,10 +1389,10 @@ static void zend_fetch_property_address(temp_variable *result, zval **container_
result->var.ptr_ptr = &EG(error_zval_ptr);
}
}
if (result) {
PZVAL_LOCK(*result->var.ptr_ptr);
}
}
}
static inline zend_brk_cont_element* zend_brk_cont(int nest_levels, int array_offset, zend_op_array *op_array, temp_variable *Ts TSRMLS_DC)
@ -1438,7 +1438,7 @@ static int zend_check_symbol(zval **pz TSRMLS_DC)
} else if (Z_TYPE_PP(pz) == IS_ARRAY) {
zend_hash_apply(Z_ARRVAL_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
} else if (Z_TYPE_PP(pz) == IS_OBJECT) {
/* OBJ-TBI - doesn't support new object model! */
zend_hash_apply(Z_OBJPROP_PP(pz), (apply_func_t) zend_check_symbol TSRMLS_CC);
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -127,7 +127,7 @@ static inline int i_zend_is_true(zval *op)
break;
}
}
if(EG(ze1_compatibility_mode)) {
result = (zend_hash_num_elements(Z_OBJPROP_P(op))?1:0);
} else {

View File

@ -493,7 +493,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
}
if (UG(unicode)) {
if (Z_TYPE(const_value) == IS_UNICODE &&
if (Z_TYPE(const_value) == IS_UNICODE &&
Z_USTRLEN(const_value) == str_index_len-1 &&
!u_strncmp(Z_USTRVAL(const_value), (UChar*)str_index, str_index_len)) {
/* constant value is the same as its name */
@ -502,7 +502,7 @@ ZEND_API int zval_update_constant(zval **pp, void *arg TSRMLS_DC)
continue;
}
} else {
if (Z_TYPE(const_value) == IS_STRING &&
if (Z_TYPE(const_value) == IS_STRING &&
Z_STRLEN(const_value) == str_index_len-1 &&
!strncmp(Z_STRVAL(const_value), str_index, str_index_len)) {
/* constant value is the same as its name */
@ -682,7 +682,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_class_entry **ce;
int found = FAILURE;
if (EG(active_op_array) &&
if (EG(active_op_array) &&
Z_UNILEN_PP(fci->object_pp) == sizeof("self")-1 &&
ZEND_U_EQUAL(Z_TYPE_PP(fci->object_pp), Z_UNIVAL_PP(fci->object_pp), Z_UNILEN_PP(fci->object_pp), "self", sizeof("self")-1)) {
if (!EG(active_op_array)->scope) {
@ -712,7 +712,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (found == FAILURE) {
zend_error(E_ERROR, "Class '%R' not found", Z_TYPE_PP(fci->object_pp), Z_UNIVAL_PP(fci->object_pp));
}
if (scope && EG(This) &&
if (scope && EG(This) &&
instanceof_function(Z_OBJCE_P(EG(This)), scope TSRMLS_CC) &&
instanceof_function(scope, *ce TSRMLS_CC)) {
fci->object_pp = &EG(This);
@ -794,7 +794,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
if (Z_OBJ_HT_PP(fci->object_pp)->get_method == NULL) {
zend_error(E_ERROR, "Object does not support method calls");
}
EX(function_state).function =
EX(function_state).function =
Z_OBJ_HT_PP(fci->object_pp)->get_method(fci->object_pp, fname, fname_len TSRMLS_CC);
if (EX(function_state).function && calling_scope != EX(function_state).function->common.scope) {
void *function_name_lc = zend_u_str_tolower_dup(Z_TYPE_P(fci->function_name), fname, fname_len);
@ -808,7 +808,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
unsigned int lcname_len;
char *lcname = zend_u_str_case_fold(Z_TYPE_P(fci->function_name), fname, fname_len, 1, &lcname_len);
EX(function_state).function =
EX(function_state).function =
zend_std_get_static_method(calling_scope, lcname, lcname_len TSRMLS_CC);
efree(lcname);
if (check_scope_or_static && EX(function_state).function
@ -827,7 +827,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
efree(lcname);
}
if (EX(function_state).function == NULL) {
if (EX(function_state).function == NULL) {
/* try calling __call */
if (calling_scope && calling_scope->__call) {
EX(function_state).function = calling_scope->__call;
@ -860,13 +860,13 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
calling_scope = fci_cache->calling_scope;
fci->object_pp = fci_cache->object_pp;
}
if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (EX(function_state).function->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
if (EX(function_state).function->common.fn_flags & ZEND_ACC_ABSTRACT) {
zend_error_noreturn(E_ERROR, "Cannot call abstract method %v::%v()", EX(function_state).function->common.scope->name, EX(function_state).function->common.function_name);
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
@ -1044,7 +1044,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, void *name, int name_length
if (name == NULL) {
return FAILURE;
}
lc_name = zend_u_str_case_fold(type, name, name_length, 1, &lc_name_len);
if (zend_u_hash_find(EG(class_table), type, lc_name, lc_name_len+1, (void **) ce) == SUCCESS) {
@ -1064,7 +1064,7 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, void *name, int name_length
ALLOC_HASHTABLE(EG(in_autoload));
zend_u_hash_init(EG(in_autoload), 0, NULL, NULL, 0, UG(unicode));
}
if (zend_u_hash_add(EG(in_autoload), type, lc_name, lc_name_len+1, (void**)&dummy, sizeof(char), NULL) == FAILURE) {
efree(lc_name);
return FAILURE;
@ -1079,9 +1079,9 @@ ZEND_API int zend_u_lookup_class_ex(zend_uchar type, void *name, int name_length
} else {
ZVAL_STRINGL(class_name_ptr, name, name_length, 1);
}
args[0] = &class_name_ptr;
fcall_info.size = sizeof(fcall_info);
fcall_info.function_table = EG(function_table);
fcall_info.function_name = &autoload_function;
@ -1307,7 +1307,7 @@ void execute_new_code(TSRMLS_D)
if (local_retval) {
zval_ptr_dtor(&local_retval);
}
if (EG(exception)) {
zend_exception_error(EG(exception) TSRMLS_CC);
}
@ -1588,9 +1588,9 @@ void zend_verify_abstract_class(zend_class_entry *ce TSRMLS_DC)
zend_hash_apply_with_argument(&ce->function_table, (apply_func_arg_t) zend_verify_abstract_class_function, &ai TSRMLS_CC);
if (ai.cnt) {
zend_error(E_ERROR, "Class %v contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
ce->name, ai.cnt,
if (ai.cnt) {
zend_error(E_ERROR, "Class %v contains %d abstract method%s and must therefore be declared abstract or implement the remaining methods (" MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT MAX_ABSTRACT_INFO_FMT ")",
ce->name, ai.cnt,
ai.cnt > 1 ? "s" : "",
DISPLAY_ABSTRACT_FN(0),
DISPLAY_ABSTRACT_FN(1),

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -78,7 +78,7 @@ int zend_load_extension(char *path)
new_extension->name);
DL_UNLOAD(handle);
return FAILURE;
}
}
} else if (ZTS_V!=extension_version_info->thread_safe) {
fprintf(stderr, "Cannot load %s - it %s thread safe, whereas Zend %s\n",
new_extension->name,
@ -229,10 +229,10 @@ ZEND_API zend_extension *zend_get_extension(char *extension_name)
* Support for dynamic loading of MH_BUNDLEs on Darwin / Mac OS X
*
*/
#if HAVE_MACH_O_DYLD_H
void *zend_mh_bundle_load(char* bundle_path)
void *zend_mh_bundle_load(char* bundle_path)
{
NSObjectFileImage bundle_image;
NSModule bundle_handle;
@ -242,17 +242,17 @@ void *zend_mh_bundle_load(char* bundle_path)
if (NSCreateObjectFileImageFromFile(bundle_path, &bundle_image) != NSObjectFileImageSuccess) {
return NULL;
}
bundle_handle = NSLinkModule(bundle_image, bundle_path, NSLINKMODULE_OPTION_PRIVATE);
NSDestroyObjectFileImage(bundle_image);
/* call the init function of the bundle */
bundle_init_nssymbol = NSLookupSymbolInModule(bundle_handle, "__init");
if (bundle_init_nssymbol != NULL) {
bundle_init = NSAddressOfSymbol(bundle_init_nssymbol);
bundle_init();
}
return bundle_handle;
}
@ -260,14 +260,14 @@ int zend_mh_bundle_unload(void *bundle_handle)
{
NSSymbol bundle_fini_nssymbol;
void (*bundle_fini)(void);
/* call the fini function of the bundle */
bundle_fini_nssymbol = NSLookupSymbolInModule(bundle_handle, "__fini");
if (bundle_fini_nssymbol != NULL) {
bundle_fini = NSAddressOfSymbol(bundle_fini_nssymbol);
bundle_fini();
}
return (int) NSUnLinkModule(bundle_handle, NULL);
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -72,7 +72,7 @@ struct _zend_extension {
op_array_handler_func_t op_array_handler;
statement_handler_func_t statement_handler;
statement_handler_func_t statement_handler;
fcall_begin_handler_func_t fcall_begin_handler;
fcall_end_handler_func_t fcall_end_handler;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -1694,10 +1694,10 @@ ZEND_API int zend_u_symtable_update_current_key(HashTable *ht, zend_uchar type,
zend_uchar key_type;
if (type == IS_STRING) {
key_type = HASH_KEY_IS_STRING;
key_type = HASH_KEY_IS_STRING;
HANDLE_NUMERIC((char*)arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx));
} else if (type == IS_UNICODE) {
key_type = HASH_KEY_IS_UNICODE;
key_type = HASH_KEY_IS_UNICODE;
HANDLE_U_NUMERIC((UChar*)arKey, nKeyLength, zend_hash_update_current_key(ht, HASH_KEY_IS_LONG, NULL, 0, idx));
}
return zend_hash_update_current_key(ht, key_type, arKey, nKeyLength, 0);

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -268,7 +268,7 @@ ZEND_API int zend_hash_rehash(HashTable *ht);
* numbers are not useable at all. The remaining 128 odd numbers
* (except for the number 1) work more or less all equally well. They
* all distribute in an acceptable way and this way fill a hash table
* with an average percent of approx. 86%.
* with an average percent of approx. 86%.
*
* If one compares the Chi^2 values of the variants, the number 33 not
* even has the best value. But the number 33 and a few other equally

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -104,10 +104,10 @@ ZEND_API void zend_highlight(zend_syntax_highlighter_ini *syntax_highlighter_ini
case T_CONSTANT_ENCAPSED_STRING:
next_color = syntax_highlighter_ini->highlight_string;
break;
case '"':
case '"':
next_color = syntax_highlighter_ini->highlight_string;
in_string = !in_string;
break;
break;
case T_WHITESPACE:
zend_html_puts(LANG_SCNG(yy_text), LANG_SCNG(yy_leng) TSRMLS_CC); /* no color needed */
Z_TYPE(token) = 0;
@ -193,7 +193,7 @@ ZEND_API void zend_strip(TSRMLS_D)
case EOF:
return;
case T_END_HEREDOC:
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
efree(Z_STRVAL(token));
@ -205,7 +205,7 @@ ZEND_API void zend_strip(TSRMLS_D)
prev_space = 1;
Z_TYPE(token) = 0;
continue;
default:
zend_write(LANG_SCNG(yy_text), LANG_SCNG(yy_leng));
break;
@ -238,4 +238,3 @@ ZEND_API void zend_strip(TSRMLS_D)
* indent-tabs-mode: t
* End:
*/

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -26,7 +26,7 @@
#include "zend_operators.h"
#include "zend_strtod.h"
static HashTable *registered_zend_ini_directives;
static HashTable *registered_zend_ini_directives;
#define NO_VALUE_PLAINTEXT "no value"
#define NO_VALUE_HTML "<i>no value</i>"
@ -123,7 +123,7 @@ static int ini_key_compare(const void *a, const void *b TSRMLS_DC)
{
Bucket *f;
Bucket *s;
f = *((Bucket **) a);
s = *((Bucket **) b);
@ -232,7 +232,7 @@ ZEND_API int zend_alter_ini_entry(char *name, uint name_length, char *new_value,
}
duplicate = estrndup(new_value, new_value_length);
if (!ini_entry->on_modify
|| ini_entry->on_modify(ini_entry, duplicate, new_value_length, ini_entry->mh_arg1, ini_entry->mh_arg2, ini_entry->mh_arg3, stage TSRMLS_CC)==SUCCESS) {
if (!ini_entry->modified) {
@ -354,7 +354,7 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
} else {
display_string = NO_VALUE_PLAINTEXT;
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
}
}
}
} else if (ini_entry->value && ini_entry->value[0]) {
display_string = ini_entry->value;
@ -366,7 +366,7 @@ static void zend_ini_displayer_cb(zend_ini_entry *ini_entry, int type)
} else {
display_string = NO_VALUE_PLAINTEXT;
display_string_length = sizeof(NO_VALUE_PLAINTEXT)-1;
}
}
}
ZEND_WRITE(display_string, display_string_length);
}
@ -401,7 +401,7 @@ ZEND_INI_DISP(zend_ini_boolean_displayer_cb)
else {
value = atoi(tmp_value);
}
if (value) {
ZEND_PUTS("On");
} else {
@ -426,13 +426,13 @@ ZEND_INI_DISP(zend_ini_color_displayer_cb)
zend_printf("<font style=\"color: %s\">%s</font>", value, value);
} else {
ZEND_PUTS(value);
}
}
} else {
if (zend_uv.html_errors) {
ZEND_PUTS(NO_VALUE_HTML);
} else {
ZEND_PUTS(NO_VALUE_PLAINTEXT);
}
}
}
}
@ -476,13 +476,13 @@ ZEND_API ZEND_INI_MH(OnUpdateBool)
if (new_value_length==2 && strcasecmp("on", new_value)==0) {
*p = (zend_bool) 1;
}
}
else if (new_value_length==3 && strcasecmp("yes", new_value)==0) {
*p = (zend_bool) 1;
}
}
else if (new_value_length==4 && strcasecmp("true", new_value)==0) {
*p = (zend_bool) 1;
}
}
else {
*p = (zend_bool) atoi(new_value);
}

View File

@ -130,7 +130,7 @@ END_EXTERN_C()
#define ZEND_INI_ENTRY1(name, default_value, modifiable, on_modify, arg1) \
ZEND_INI_ENTRY1_EX(name, default_value, modifiable, on_modify, arg1, NULL)
#define ZEND_INI_ENTRY_EX(name, default_value, modifiable, on_modify, displayer) \
ZEND_INI_ENTRY3_EX(name, default_value, modifiable, on_modify, NULL, NULL, NULL, displayer)

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -29,7 +29,7 @@ ZEND_API zend_class_entry *zend_ce_iterator;
ZEND_API zend_class_entry *zend_ce_arrayaccess;
ZEND_API zend_class_entry *zend_ce_serializable;
/* {{{ zend_call_method
/* {{{ zend_call_method
Only returns the returned zval if retval_ptr != NULL */
ZEND_API zval* zend_call_method(zval **object_pp, zend_class_entry *obj_ce, zend_function **fn_proxy, char *function_name, int function_name_len, zval **retval_ptr_ptr, int param_count, zval* arg1, zval* arg2 TSRMLS_DC)
{
@ -149,7 +149,7 @@ ZEND_API int zend_user_it_valid(zend_object_iterator *_iter TSRMLS_DC)
zval *object = (zval*)iter->it.data;
zval *more;
int result;
zend_call_method_with_0_params(&object, iter->ce, &iter->ce->iterator_funcs.zf_valid, "valid", &more);
if (more) {
result = i_zend_is_true(more);
@ -202,7 +202,7 @@ ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **st
return HASH_KEY_IS_LONG;
}
switch (Z_TYPE_P(retval)) {
default:
default:
zend_error(E_WARNING, "Illegal type returned from %v::key()", iter->ce->name);
case IS_NULL:
*int_key = 0;
@ -223,7 +223,7 @@ ZEND_API int zend_user_it_get_current_key(zend_object_iterator *_iter, char **st
case IS_DOUBLE:
case IS_RESOURCE:
case IS_BOOL:
case IS_BOOL:
case IS_LONG: {
if (Z_TYPE_P(retval) == IS_DOUBLE) {
*int_key = (long)Z_DVAL_P(retval);
@ -273,7 +273,7 @@ zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
static zend_object_iterator *zend_user_it_get_iterator(zend_class_entry *ce, zval *object, int by_ref TSRMLS_DC)
{
zend_user_iterator *iterator;
if (by_ref) {
zend_error(E_ERROR, "An iterator cannot be used with foreach by reference");
}
@ -459,14 +459,14 @@ int zend_user_unserialize(zval **object, zend_class_entry *ce, const unsigned ch
zval * zdata;
object_init_ex(*object, ce);
MAKE_STD_ZVAL(zdata);
ZVAL_STRINGL(zdata, (char*)buf, buf_len, 1);
zend_call_method_with_1_params(object, ce, &ce->unserialize_func, "unserialize", NULL, zdata);
zval_ptr_dtor(&zdata);
if (EG(exception)) {
return FAILURE;
} else {
@ -517,7 +517,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_get, 0, 0, 1) /* actually this
ZEND_END_ARG_INFO();
static
ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
ZEND_BEGIN_ARG_INFO_EX(arginfo_arrayaccess_offset_value, 0, 0, 2)
ZEND_ARG_INFO(0, offset)
ZEND_ARG_INFO(0, value)
ZEND_END_ARG_INFO();
@ -537,7 +537,7 @@ ZEND_END_ARG_INFO();
zend_function_entry zend_funcs_serializable[] = {
ZEND_ABSTRACT_ME(serializable, serialize, NULL)
ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
ZEND_FENTRY(unserialize, NULL, arginfo_serializable_serialize, ZEND_ACC_PUBLIC|ZEND_ACC_ABSTRACT|ZEND_ACC_CTOR)
{NULL, NULL, NULL}
};
/* }}} */
@ -563,9 +563,9 @@ ZEND_API void zend_register_interfaces(TSRMLS_D)
REGISTER_ITERATOR_INTERFACE(iterator, Iterator);
REGISTER_ITERATOR_IMPLEMENT(iterator, traversable);
REGISTER_ITERATOR_INTERFACE(arrayaccess, ArrayAccess);
REGISTER_ITERATOR_INTERFACE(serializable, Serializable)
}
/* }}} */

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -64,7 +64,7 @@ static void iter_wrapper_dtor(void *object, zend_object_handle handle TSRMLS_DC)
ZEND_API zval *zend_iterator_wrap(zend_object_iterator *iter TSRMLS_DC)
{
zval *wrapped;
MAKE_STD_ZVAL(wrapped);
Z_TYPE_P(wrapped) = IS_OBJECT;
Z_OBJ_HANDLE_P(wrapped) = zend_objects_store_put(iter, iter_wrapper_dtor, NULL, NULL TSRMLS_CC);
@ -86,14 +86,14 @@ ZEND_API enum zend_object_iterator_kind zend_iterator_unwrap(
return ZEND_ITER_PLAIN_OBJECT;
}
return ZEND_ITER_INVALID;
case IS_ARRAY:
if (HASH_OF(array_ptr)) {
return ZEND_ITER_PLAIN_ARRAY;
}
return ZEND_ITER_INVALID;
default:
return ZEND_ITER_INVALID;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -31,7 +31,7 @@ typedef struct _zend_object_iterator zend_object_iterator;
typedef struct _zend_object_iterator_funcs {
/* release all resources associated with this iterator instance */
void (*dtor)(zend_object_iterator *iter TSRMLS_DC);
/* check for end of iteration (FAILURE or SUCCESS if data is valid) */
int (*valid)(zend_object_iterator *iter TSRMLS_DC);
@ -46,7 +46,7 @@ typedef struct _zend_object_iterator_funcs {
/* rewind to start of data (optional, may be NULL) */
void (*rewind)(zend_object_iterator *iter TSRMLS_DC);
/* invalidate current value/key (optional, may be NULL) */
void (*invalidate_current)(zend_object_iterator *iter TSRMLS_DC);
} zend_object_iterator_funcs;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -34,7 +34,7 @@ typedef struct _zend_lex_state {
UConverter *output_conv; /* converter for data from flex output */
zend_bool encoding_checked;
char* rest_str;
int rest_len;
int rest_len;
} zend_lex_state;

View File

@ -234,7 +234,7 @@ BEGIN_EXTERN_C()
ZEND_API void zend_file_handle_dtor(zend_file_handle *fh)
{
TSRMLS_FETCH();
switch (fh->type) {
case ZEND_HANDLE_FP:
fclose(fh->handle.fp);
@ -498,7 +498,7 @@ static int is_encoding_flex_compatible(const char *enc TSRMLS_DC)
case UCNV_EBCDIC_STATEFUL:
case UCNV_ISO_2022:
case UCNV_LMBCS_1:
case UCNV_LMBCS_2:
case UCNV_LMBCS_2:
case UCNV_LMBCS_3:
case UCNV_LMBCS_4:
case UCNV_LMBCS_5:
@ -743,7 +743,7 @@ ZEND_API int open_file_for_scanning(zend_file_handle *file_handle TSRMLS_DC)
}
zend_llist_add_element(&CG(open_files), file_handle);
/* Reset the scanner for scanning the new file */
SCNG(yy_in) = file_handle;
@ -1961,7 +1961,7 @@ NEWLINE ("\r"|"\n"|"\r\n")
}
Z_STRVAL_P(zendlval) = emalloc(len+1);
Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
Z_STRLEN_P(zendlval) = sprintf(Z_STRVAL_P(zendlval), "%s%s%s",
class_name ? class_name : "",
class_name && func_name ? "::" : "",
func_name ? func_name : ""

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -51,7 +51,7 @@ ZEND_API int zend_list_insert(void *ptr, int type)
ZEND_API int _zend_list_delete(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("del(%d): %d->%d\n", id, le->refcount, le->refcount-1); */
if (--le->refcount<=0) {
@ -81,7 +81,7 @@ ZEND_API void *_zend_list_find(int id, int *type TSRMLS_DC)
ZEND_API int _zend_list_addref(int id TSRMLS_DC)
{
zend_rsrc_list_entry *le;
if (zend_hash_index_find(&EG(regular_list), id, (void **) &le)==SUCCESS) {
/* printf("add(%d): %d->%d\n", id, le->refcount, le->refcount+1); */
le->refcount++;
@ -97,7 +97,7 @@ ZEND_API int zend_register_resource(zval *rsrc_result, void *rsrc_pointer, int r
int rsrc_id;
rsrc_id = zend_list_insert(rsrc_pointer, rsrc_type);
if (rsrc_result) {
Z_RESVAL_P(rsrc_result) = rsrc_id;
Z_TYPE_P(rsrc_result) = IS_RESOURCE;
@ -171,7 +171,7 @@ void list_entry_destructor(void *ptr)
zend_rsrc_list_entry *le = (zend_rsrc_list_entry *) ptr;
zend_rsrc_list_dtors_entry *ld;
TSRMLS_FETCH();
if (zend_hash_index_find(&list_destructors, le->type, (void **) &ld)==SUCCESS) {
switch (ld->type) {
case ZEND_RESOURCE_LIST_TYPE_STD:
@ -271,11 +271,11 @@ void zend_clean_module_rsrc_dtors(int module_number TSRMLS_DC)
ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void *), int module_number)
{
zend_rsrc_list_dtors_entry lde;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
lde.list_dtor=(void (*)(void *)) ld;
lde.plist_dtor=(void (*)(void *)) pld;
lde.list_dtor_ex = lde.plist_dtor_ex = NULL;
@ -283,7 +283,7 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_STD;
lde.type_name = NULL;
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}
@ -294,7 +294,7 @@ ZEND_API int zend_register_list_destructors(void (*ld)(void *), void (*pld)(void
ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_func_t pld, char *type_name, int module_number)
{
zend_rsrc_list_dtors_entry lde;
#if 0
printf("Registering destructors %d for module %d\n", list_destructors.nNextFreeElement, module_number);
#endif
@ -307,7 +307,7 @@ ZEND_API int zend_register_list_destructors_ex(rsrc_dtor_func_t ld, rsrc_dtor_fu
lde.resource_id = list_destructors.nNextFreeElement;
lde.type = ZEND_RESOURCE_LIST_TYPE_EX;
lde.type_name = type_name;
if (zend_hash_next_index_insert(&list_destructors, (void *) &lde, sizeof(zend_rsrc_list_dtors_entry), NULL)==FAILURE) {
return FAILURE;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -107,7 +107,7 @@ ZEND_API void zend_llist_del_element(zend_llist *l, void *element, int (*compare
ZEND_API void zend_llist_destroy(zend_llist *l)
{
zend_llist_element *current=l->head, *next;
while (current) {
next = current->next;
if (l->dtor) {
@ -137,7 +137,7 @@ ZEND_API void *zend_llist_remove_tail(zend_llist *l)
if (l->tail->prev) {
l->tail->prev->next = NULL;
}
data = old_tail->data;
l->tail = l->tail->prev;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -146,7 +146,7 @@ static inline void zend_mm_add_to_free_list(zend_mm_heap *heap, zend_mm_free_blo
zend_heap_activate_leaf(heap->heap, index);
}
} else {
free_list_bucket = &heap->free_buckets[0];
free_list_bucket = &heap->free_buckets[0];
}
mm_block->next_free_block = *free_list_bucket;
if (*free_list_bucket != NULL) {
@ -230,11 +230,11 @@ zend_bool zend_mm_add_memory_block(zend_mm_heap *heap, size_t block_size)
block_size -= ZEND_MM_ALIGNED_SEGMENT_SIZE;
mm_block = (zend_mm_free_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
mm_block->size = block_size - ZEND_MM_ALIGNED_HEADER_SIZE; /* keep one guard block in the end */
mm_block->type = ZEND_MM_FREE_BLOCK;
mm_block->prev_size = 0; /* Size is always at least ZEND_MM_ALIGNED_HEADER_SIZE big (>0) so 0 is OK */
/* setup guard block */
guard_block = ZEND_MM_BLOCK_AT(mm_block, mm_block->size);
guard_block->type = ZEND_MM_USED_BLOCK;
@ -287,7 +287,7 @@ void *zend_mm_alloc(zend_mm_heap *heap, size_t size)
true_size = MAX(ZEND_MM_ALIGNED_SIZE(size)+ZEND_MM_ALIGNED_HEADER_SIZE, ZEND_MM_ALIGNED_FREE_HEADER_SIZE);
index = ZEND_MM_BUCKET_INDEX(true_size);
if (index < ZEND_MM_NUM_BUCKETS) {
free_list_bucket = &heap->free_buckets[index];
if (*free_list_bucket) {
@ -299,7 +299,7 @@ void *zend_mm_alloc(zend_mm_heap *heap, size_t size)
leaf = zend_heap_search_leaf(heap->heap, index);
if (leaf != 0) {
best_fit = heap->free_buckets[leaf];
goto zend_mm_finished_searching_for_block;
goto zend_mm_finished_searching_for_block;
}
}
}
@ -348,7 +348,7 @@ void zend_mm_free(zend_mm_heap *heap, void *p)
{
zend_mm_block *mm_block = ZEND_MM_HEADER_OF(p);
zend_mm_block *prev_block, *next_block;
if (mm_block->type != ZEND_MM_USED_BLOCK) {
/* error */
return;
@ -430,7 +430,7 @@ void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size)
break;
}
seg = seg->next_segment;
}
}
}
mm_block = (zend_mm_block *) ((char *) segment + ZEND_MM_ALIGNED_SEGMENT_SIZE);
}
@ -449,7 +449,7 @@ void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size)
if (next_block->type != ZEND_MM_FREE_BLOCK || (mm_block->size + next_block->size < true_size)) {
void *ptr;
ptr = zend_mm_alloc(heap, size);
memcpy(ptr, p, mm_block->size - ZEND_MM_ALIGNED_HEADER_SIZE);
zend_mm_free(heap, p);
@ -460,7 +460,7 @@ void *zend_mm_realloc(zend_mm_heap *heap, void *p, size_t size)
mm_block->size += next_block->size;
/* update the next block's prev_size */
ZEND_MM_BLOCK_AT(mm_block, mm_block->size)->prev_size = mm_block->size;
zend_mm_create_new_free_block(heap, mm_block, true_size);
return p;

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@ -46,7 +46,7 @@
enable accessors to change properties array.
if we have __call and method which is not part of the class function table is
called, we cal __call handler.
called, we cal __call handler.
*/
static HashTable *zend_std_get_properties(zval *object TSRMLS_DC)
@ -60,13 +60,13 @@ static zval *zend_std_call_getter(zval *object, zval *member TSRMLS_DC)
{
zval *retval = NULL;
zend_class_entry *ce = Z_OBJCE_P(object);
/* __get handler is called with one argument:
property name
it should return whether the call was successfull or not
*/
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__get, ZEND_GET_FUNC_NAME, &retval, member);
@ -112,11 +112,11 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC)
{
zend_class_entry *ce = Z_OBJCE_P(object);
/* __unset handler is called with one argument:
property name
*/
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member);
@ -128,13 +128,13 @@ static zval *zend_std_call_issetter(zval *object, zval *member TSRMLS_DC)
{
zval *retval = NULL;
zend_class_entry *ce = Z_OBJCE_P(object);
/* __isset handler is called with one argument:
property name
it should return whether the property is set or not
*/
SEPARATE_ARG_IF_REF(member);
zend_call_method_with_1_params(&object, ce, &ce->__isset, ZEND_ISSET_FUNC_NAME, &retval, member);
@ -191,7 +191,7 @@ ZEND_API struct _zend_property_info *zend_get_property_info(zend_class_entry *ce
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
return NULL;
return NULL;
}
h = zend_u_get_hash_value(Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member) + 1);
if (zend_u_hash_quick_find(&ce->properties_info, Z_TYPE_P(member), Z_UNIVAL_P(member), Z_UNILEN_P(member)+1, h, (void **) &property_info)==SUCCESS) {
@ -323,7 +323,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
#endif
#endif
/* make zend_get_property_info silent if we have getter - we may want to use it */
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
@ -342,7 +342,7 @@ zval *zend_std_read_property(zval *object, zval *member, int type TSRMLS_DC)
if (rv) {
retval = &rv;
} else {
retval = &EG(uninitialized_zval_ptr);
retval = &EG(uninitialized_zval_ptr);
}
} else {
if (!silent) {
@ -435,7 +435,7 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type TSRMLS_DC)
{
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
if(offset == NULL) {
/* [] construct */
@ -488,7 +488,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty TS
zend_class_entry *ce = Z_OBJCE_P(object);
zval *retval;
int result;
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetexists", &retval, offset);
@ -520,7 +520,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
zval tmp_member;
zval **retval;
zend_property_info *property_info;
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
@ -532,7 +532,7 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member TSRMLS_DC
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Ptr object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
#endif
#endif
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__get != NULL) TSRMLS_CC);
@ -566,7 +566,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
zend_object *zobj;
zval *tmp_member = NULL;
zend_property_info *property_info;
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
@ -579,7 +579,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
}
property_info = zend_get_property_info(zobj->ce, member, (zobj->ce->__unset != NULL) TSRMLS_CC);
if (!property_info || zend_u_hash_del(zobj->properties, Z_TYPE_P(member), property_info->name, property_info->name_length+1)) {
zend_guard *guard;
@ -602,7 +602,7 @@ static void zend_std_unset_property(zval *object, zval *member TSRMLS_DC)
static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC)
{
zend_class_entry *ce = Z_OBJCE_P(object);
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
@ -619,7 +619,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
zval *method_name_ptr, *method_args_ptr;
zval *method_result_ptr = NULL;
zend_class_entry *ce = Z_OBJCE_P(this_ptr);
ALLOC_ZVAL(method_args_ptr);
INIT_PZVAL(method_args_ptr);
array_init(method_args_ptr);
@ -648,7 +648,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS)
RETVAL_ZVAL(method_result_ptr, 0, 1);
}
}
/* now destruct all auxiliaries */
zval_ptr_dtor(&method_args_ptr);
zval_ptr_dtor(&method_name_ptr);
@ -738,13 +738,13 @@ static union _zend_function *zend_std_get_method(zval **object_ptr, char *method
unsigned int lc_method_name_len;
char *lc_method_name;
zval *object = *object_ptr;
/* FIXME: type is default */
zend_uchar type = UG(unicode)?IS_UNICODE:IS_STRING;
/* Create a zend_copy_str_tolower(dest, src, src_length); */
lc_method_name = zend_u_str_case_fold(type, method_name, method_len, 1, &lc_method_name_len);
zobj = Z_OBJ_P(object);
if (zend_u_hash_find(&zobj->ce->function_table, type, lc_method_name, lc_method_name_len+1, (void **)&fbc) == FAILURE) {
efree(lc_method_name);
@ -837,7 +837,7 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, char *f
/* Ensure that if we're calling a private function, we're allowed to do so.
*/
updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
updated_fbc = zend_check_private_int(fbc, EG(scope), function_name_strval, function_name_strlen TSRMLS_CC);
if (!updated_fbc) {
zend_error(E_ERROR, "Call to %s method %v::%v() from context '%v'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), fbc->common.function_name, EG(scope) ? EG(scope)->name : (char*)EMPTY_STR);
}
@ -891,7 +891,7 @@ ZEND_API zval **zend_std_get_static_property(zend_class_entry *ce, zend_uchar ty
zend_error(E_ERROR, "Access to undeclared static property: %v::$%R", ce->name, type, property_name);
}
}
return retval;
}
@ -936,7 +936,7 @@ int zend_compare_symbol_tables_i(HashTable *ht1, HashTable *ht2 TSRMLS_DC);
static int zend_std_compare_objects(zval *o1, zval *o2 TSRMLS_DC)
{
zend_object *zobj1, *zobj2;
zobj1 = Z_OBJ_P(o1);
zobj2 = Z_OBJ_P(o2);
@ -953,7 +953,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
zval **value;
zval *tmp_member = NULL;
zend_property_info *property_info;
zobj = Z_OBJ_P(object);
if (Z_TYPE_P(member) != IS_UNICODE && (UG(unicode) || Z_TYPE_P(member) != IS_STRING)) {
@ -967,7 +967,7 @@ static int zend_std_has_property(zval *object, zval *member, int has_set_exists
#if DEBUG_OBJECT_HANDLERS
fprintf(stderr, "Read object #%d property: %R\n", Z_OBJ_HANDLE_P(object), Z_TYPE_P(member), Z_STRVAL_P(member));
#endif
#endif
property_info = zend_get_property_info(zobj->ce, member, 1 TSRMLS_CC);
@ -1112,7 +1112,7 @@ ZEND_API zend_object_handlers std_object_handlers = {
zend_objects_store_add_ref, /* add_ref */
zend_objects_store_del_ref, /* del_ref */
zend_objects_clone_obj, /* clone_obj */
zend_std_read_property, /* read_property */
zend_std_write_property, /* write_property */
zend_std_read_dimension, /* read_dimension */

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@ -33,7 +33,7 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
if (destructor) {
zval zobj, *obj = &zobj;
zval *old_exception;
if (destructor->op_array.fn_flags & (ZEND_ACC_PRIVATE|ZEND_ACC_PROTECTED)) {
if (destructor->op_array.fn_flags & ZEND_ACC_PRIVATE) {
/* Ensure that if we're calling a private function, we're allowed to do so.
@ -41,10 +41,10 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
if (object->ce != EG(scope)) {
zend_class_entry *ce = object->ce;
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
"Call to private %v::__destruct() from context '%v'%s",
ce->name,
EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
"Call to private %v::__destruct() from context '%v'%s",
ce->name,
EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
EG(in_execution) ? "" : " during shutdown ignored");
return;
}
@ -54,10 +54,10 @@ ZEND_API void zend_objects_destroy_object(zend_object *object, zend_object_handl
if (!zend_check_protected(destructor->common.scope, EG(scope))) {
zend_class_entry *ce = object->ce;
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
"Call to protected %v::__destruct() from context '%v'%s",
ce->name,
EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
zend_error(EG(in_execution) ? E_ERROR : E_WARNING,
"Call to protected %v::__destruct() from context '%v'%s",
ce->name,
EG(scope) ? EG(scope)->name : (char*)EMPTY_STR,
EG(in_execution) ? "" : " during shutdown ignored");
return;
}
@ -90,7 +90,7 @@ ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
{
if (object->guards) {
zend_hash_destroy(object->guards);
FREE_HASHTABLE(object->guards);
FREE_HASHTABLE(object->guards);
}
zend_hash_destroy(object->properties);
FREE_HASHTABLE(object->properties);
@ -98,7 +98,7 @@ ZEND_API void zend_objects_free_object_storage(zend_object *object TSRMLS_DC)
}
ZEND_API zend_object_value zend_objects_new(zend_object **object, zend_class_entry *class_type TSRMLS_DC)
{
{
zend_object_value retval;
*object = emalloc(sizeof(zend_object));
@ -162,7 +162,7 @@ ZEND_API zend_object_value zend_objects_clone_obj(zval *zobject TSRMLS_DC)
zend_object *new_object;
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
/* assume that create isn't overwritten, so when clone depends on the
/* assume that create isn't overwritten, so when clone depends on the
* overwritten one then it must itself be overwritten */
old_object = zend_objects_get_address(zobject TSRMLS_CC);
new_obj_val = zend_objects_new(&new_object, old_object->ce TSRMLS_CC);

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+
@ -96,7 +96,7 @@ ZEND_API zend_object_handle zend_objects_store_put(void *object, zend_objects_st
{
zend_object_handle handle;
struct _store_object *obj;
if (EG(objects_store).free_list_head != -1) {
handle = EG(objects_store).free_list_head;
EG(objects_store).free_list_head = EG(objects_store).object_buckets[handle].bucket.free_list.next;
@ -143,14 +143,14 @@ ZEND_API void zend_objects_store_del_ref(zval *zobject TSRMLS_DC)
{
zend_object_handle handle;
struct _store_object *obj;
if (!EG(objects_store).object_buckets) {
return;
}
handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
/* Make sure we hold a reference count during the destructor call
otherwise, when the destructor ends the storage might be freed
when the refcount reaches 0 a second time
@ -194,16 +194,16 @@ ZEND_API zend_object_value zend_objects_store_clone_obj(zval *zobject TSRMLS_DC)
zend_object_handle handle = Z_OBJ_HANDLE_P(zobject);
obj = &EG(objects_store).object_buckets[handle].bucket.obj;
if (obj->clone == NULL) {
zend_error(E_CORE_ERROR, "Trying to clone uncloneable object of class %v", Z_OBJCE_P(zobject)->name);
}
}
obj->clone(obj->object, &new_object TSRMLS_CC);
retval.handle = zend_objects_store_put(new_object, obj->dtor, obj->free_storage, obj->clone TSRMLS_CC);
retval.handlers = Z_OBJ_HT_P(zobject);
return retval;
}
@ -276,7 +276,7 @@ ZEND_API zval *zend_object_create_proxy(zval *object, zval *member TSRMLS_DC)
Z_TYPE_P(retval) = IS_OBJECT;
Z_OBJ_HANDLE_P(retval) = zend_objects_store_put(pobj, NULL, (zend_objects_free_object_storage_t) zend_objects_proxy_free_storage, (zend_objects_store_clone_t) zend_objects_proxy_clone TSRMLS_CC);
Z_OBJ_HT_P(retval) = &zend_object_proxy_handlers;
return retval;
}
@ -311,7 +311,7 @@ ZEND_API zend_object_handlers *zend_get_std_object_handlers()
static zend_object_handlers zend_object_proxy_handlers = {
ZEND_OBJECTS_STORE_HANDLERS,
NULL, /* read_property */
NULL, /* write_property */
NULL, /* read dimension */

View File

@ -1,4 +1,4 @@
/*
/*
+----------------------------------------------------------------------+
| Zend Engine |
+----------------------------------------------------------------------+

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -135,7 +135,7 @@ ZEND_API int zend_cleanup_function_data(zend_function *function TSRMLS_DC)
{
if (function->type == ZEND_USER_FUNCTION) {
zend_cleanup_op_array_data((zend_op_array *) function);
}
}
return 0;
}
@ -162,7 +162,7 @@ ZEND_API int zend_cleanup_class_data(zend_class_entry **pce TSRMLS_DC)
ZEND_API void destroy_zend_class(zend_class_entry **pce)
{
zend_class_entry *ce = *pce;
if (--ce->refcount > 0) {
return;
}
@ -296,9 +296,9 @@ zend_op *get_next_op(zend_op_array *op_array TSRMLS_DC)
op_array->size *= 4;
op_array_alloc_ops(op_array);
}
next_op = &(op_array->opcodes[next_op_num]);
init_op(next_op TSRMLS_CC);
return next_op;
@ -388,7 +388,7 @@ int pass_two(zend_op_array *op_array TSRMLS_DC)
ZEND_VM_SET_OPCODE_HANDLER(opline);
opline++;
}
op_array->done_pass_two = 1;
return 0;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -462,7 +462,7 @@ ZEND_API void convert_to_double(zval *op)
{
double retval = 1.0;
TSRMLS_FETCH();
convert_object_to_type(op, IS_DOUBLE, convert_to_double);
if (Z_TYPE_P(op) == IS_DOUBLE) {
@ -481,7 +481,7 @@ ZEND_API void convert_to_double(zval *op)
zval_dtor(op);
ZVAL_DOUBLE(op, retval);
break;
}
}
default:
zend_error(E_WARNING, "Cannot convert to real value (type=%d)", Z_TYPE_P(op));
zval_dtor(op);
@ -578,14 +578,14 @@ ZEND_API void convert_to_boolean(zval *op)
if (Z_TYPE_P(op) == IS_BOOL) {
return;
}
if (EG(ze1_compatibility_mode)) {
HashTable *ht = Z_OBJPROP_P(op);
if (ht) {
retval = (zend_hash_num_elements(ht)?1:0);
}
}
zval_dtor(op);
ZVAL_BOOL(op, retval);
break;
@ -640,7 +640,7 @@ ZEND_API void _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC)
int32_t capacity;
double dval = Z_DVAL_P(op);
TSRMLS_FETCH();
capacity = MAX_LENGTH_OF_DOUBLE + EG(precision) + 1;
Z_USTRVAL_P(op) = eumalloc_rel(capacity);
Z_USTRLEN_P(op) = u_sprintf(Z_USTRVAL_P(op), "%.*G", (int) EG(precision), dval);
@ -654,7 +654,7 @@ ZEND_API void _convert_to_unicode(zval *op TSRMLS_DC ZEND_FILE_LINE_DC)
break;
case IS_OBJECT: {
TSRMLS_FETCH();
convert_object_to_type(op, IS_UNICODE, convert_to_unicode);
if (Z_TYPE_P(op) == IS_UNICODE) {
@ -737,7 +737,7 @@ ZEND_API void _convert_to_string_with_converter(zval *op, UConverter *conv TSRML
break;
case IS_OBJECT: {
TSRMLS_FETCH();
convert_object_to_type(op, IS_STRING, convert_to_string);
if (Z_TYPE_P(op) == IS_STRING) {
@ -762,11 +762,11 @@ ZEND_API void _convert_to_string_with_converter(zval *op, UConverter *conv TSRML
static void convert_scalar_to_array(zval *op, int type TSRMLS_DC)
{
zval *entry;
ALLOC_ZVAL(entry);
*entry = *op;
INIT_PZVAL(entry);
switch (type) {
case IS_ARRAY:
ALLOC_HASHTABLE(Z_ARRVAL_P(op));
@ -862,14 +862,14 @@ ZEND_API void multi_convert_to_long_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_long_ex(arg);
}
va_end(ap);
}
@ -877,14 +877,14 @@ ZEND_API void multi_convert_to_double_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_double_ex(arg);
}
va_end(ap);
}
@ -892,14 +892,14 @@ ZEND_API void multi_convert_to_string_ex(int argc, ...)
{
zval **arg;
va_list ap;
va_start(ap, argc);
while (argc--) {
while (argc--) {
arg = va_arg(ap, zval **);
convert_to_string_ex(arg);
}
va_end(ap);
}
@ -927,9 +927,9 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) {
long lval = Z_LVAL_P(op1) + Z_LVAL_P(op2);
/* check for overflow by comparing sign bits */
if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) == (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) + (double) Z_LVAL_P(op2);
@ -961,15 +961,15 @@ ZEND_API int add_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
if (Z_TYPE_P(op1) == IS_LONG && Z_TYPE_P(op2) == IS_LONG) {
long lval = Z_LVAL_P(op1) - Z_LVAL_P(op2);
/* check for overflow by comparing sign bits */
if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
if ( (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (Z_LVAL_P(op2) & LONG_SIGN_MASK)
&& (Z_LVAL_P(op1) & LONG_SIGN_MASK) != (lval & LONG_SIGN_MASK)) {
Z_DVAL_P(result) = (double) Z_LVAL_P(op1) - (double) Z_LVAL_P(op2);
@ -1001,7 +1001,7 @@ ZEND_API int sub_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
@ -1009,7 +1009,7 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
long overflow;
ZEND_SIGNED_MULTIPLY_LONG(Z_LVAL_P(op1), Z_LVAL_P(op2), Z_LVAL_P(result), Z_DVAL_P(result),overflow);
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
Z_TYPE_P(result) = overflow ? IS_DOUBLE : IS_LONG;
return SUCCESS;
}
if ((Z_TYPE_P(op1) == IS_DOUBLE && Z_TYPE_P(op2) == IS_LONG)
@ -1032,7 +1032,7 @@ ZEND_API int mul_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zendi_convert_scalar_to_number(op1, op1_copy, result);
zendi_convert_scalar_to_number(op2, op2_copy, result);
@ -1072,7 +1072,7 @@ ZEND_API int div_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
zendi_convert_to_long(op1, op1_copy, result);
zendi_convert_to_long(op2, op2_copy, result);
@ -1096,7 +1096,7 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
Z_TYPE_P(result) = IS_BOOL;
zendi_convert_to_boolean(op1, op1_copy, result);
@ -1109,7 +1109,7 @@ ZEND_API int boolean_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy;
zendi_convert_to_boolean(op1, op1_copy, result);
Z_TYPE_P(result) = IS_BOOL;
@ -1121,9 +1121,9 @@ ZEND_API int boolean_not_function(zval *result, zval *op1 TSRMLS_DC)
ZEND_API int bitwise_not_function(zval *result, zval *op1 TSRMLS_DC)
{
zval op1_copy = *op1;
op1 = &op1_copy;
if (Z_TYPE_P(op1) == IS_DOUBLE) {
Z_LVAL_P(op1) = (long) Z_DVAL_P(op1);
Z_TYPE_P(op1) = IS_LONG;
@ -1195,7 +1195,7 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) {
zval *longer, *shorter;
char *result_str;
@ -1222,7 +1222,7 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
Z_STRLEN_P(result) = result_len;
return SUCCESS;
}
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
@ -1240,7 +1240,7 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
if (Z_TYPE_P(op1) == IS_STRING && Z_TYPE_P(op2) == IS_STRING) {
zval *longer, *shorter;
char *result_str;
@ -1274,7 +1274,7 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
zendi_convert_to_long(op1, op1_copy, result);
zendi_convert_to_long(op2, op2_copy, result);
zendi_convert_to_long(op2, op2_copy, result);
Z_TYPE_P(result) = IS_LONG;
Z_LVAL_P(result) = Z_LVAL_P(op1) ^ Z_LVAL_P(op2);
@ -1285,7 +1285,7 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
@ -1302,7 +1302,7 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
{
zval op1_copy, op2_copy;
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
zend_error(E_ERROR, "Unsupported operand types");
return FAILURE;
@ -1526,7 +1526,7 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
zval *op1_free, *op2_free;
int op1_obj = Z_TYPE_P(op1) == IS_OBJECT;
int op2_obj = Z_TYPE_P(op2) == IS_OBJECT;
if (op1_obj) {
if (Z_OBJ_HT_P(op1)->get) {
op1 = op1_free = Z_OBJ_HT_P(op1)->get(op1 TSRMLS_CC);
@ -1573,8 +1573,8 @@ ZEND_API int compare_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
COMPARE_RETURN_AND_FREE(SUCCESS);
}
}
if ((Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op1) == IS_STRING) &&
if ((Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op1) == IS_STRING) &&
(Z_TYPE_P(op2) == IS_UNICODE || Z_TYPE_P(op2) == IS_STRING)) {
if (Z_TYPE_P(op1) == IS_UNICODE || Z_TYPE_P(op2) == IS_UNICODE) {
@ -1872,7 +1872,7 @@ static void increment_string(zval *str)
char *t;
int last=0; /* Shut up the compiler warning */
int ch;
if (Z_STRLEN_P(str) == 0) {
STR_FREE(Z_STRVAL_P(str));
Z_STRVAL_P(str) = estrndup("1", sizeof("1")-1);
@ -1951,7 +1951,7 @@ ZEND_API int increment_function(zval *op1)
ZVAL_DOUBLE(op1, d+1);
} else {
Z_LVAL_P(op1)++;
}
}
break;
case IS_DOUBLE:
Z_DVAL_P(op1) = Z_DVAL_P(op1) + 1;
@ -2003,7 +2003,7 @@ ZEND_API int decrement_function(zval *op1)
{
long lval;
double dval;
switch (Z_TYPE_P(op1)) {
case IS_LONG:
if (Z_LVAL_P(op1) == LONG_MIN) {
@ -2071,7 +2071,7 @@ ZEND_API char *zend_str_tolower_copy(char *dest, const char *source, unsigned in
return dest;
}
ZEND_API char *zend_str_tolower_dup(const char *source, unsigned int length)
{
return zend_str_tolower_copy((char *)emalloc(length+1), source, length);
@ -2094,7 +2094,7 @@ ZEND_API void *zend_u_str_tolower_copy(zend_uchar type, void *dest, const void *
return zend_str_tolower_copy(dest, source, length);
}
}
ZEND_API void *zend_u_str_tolower_dup(zend_uchar type, const void *source, unsigned int length)
{
if (type == IS_UNICODE) {
@ -2154,7 +2154,7 @@ ZEND_API void *zend_u_str_case_fold(zend_uchar type, const void *source, unsigne
ZEND_API int zend_binary_strcmp(char *s1, uint len1, char *s2, uint len2)
{
int retval;
retval = memcmp(s1, s2, MIN(len1, len2));
if (!retval) {
return (len1 - len2);
@ -2174,7 +2174,7 @@ ZEND_API int zend_u_binary_strcmp(UChar *s1, int32_t len1, UChar *s2, int32_t le
ZEND_API int zend_binary_strncmp(char *s1, uint len1, char *s2, uint len2, uint length)
{
int retval;
retval = memcmp(s1, s2, MIN(length, MIN(len1, len2)));
if (!retval) {
return (MIN(length, len1) - MIN(length, len2));
@ -2306,7 +2306,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
int ret1, ret2;
long lval1, lval2;
double dval1, dval2;
if ((ret1=is_numeric_string(Z_STRVAL_P(s1), Z_STRLEN_P(s1), &lval1, &dval1, 0)) &&
(ret2=is_numeric_string(Z_STRVAL_P(s2), Z_STRLEN_P(s2), &lval2, &dval2, 0))) {
if ((ret1==IS_DOUBLE) || (ret2==IS_DOUBLE)) {
@ -2328,7 +2328,7 @@ ZEND_API void zendi_smart_strcmp(zval *result, zval *s1, zval *s2)
Z_LVAL_P(result) = ZEND_NORMALIZE_BOOL(Z_LVAL_P(result));
Z_TYPE_P(result) = IS_LONG;
}
return;
return;
}
@ -2339,7 +2339,7 @@ ZEND_API void zendi_u_smart_strcmp(zval *result, zval *s1, zval *s2)
double dval1, dval2;
zval s1_copy, s2_copy;
int use_copy1 = 0, use_copy2 = 0;
if (Z_TYPE_P(s1) != IS_UNICODE || Z_TYPE_P(s2) != IS_UNICODE) {
zend_make_unicode_zval(s1, &s1_copy, &use_copy1);
zend_make_unicode_zval(s2, &s2_copy, &use_copy2);
@ -2379,7 +2379,7 @@ ZEND_API void zendi_u_smart_strcmp(zval *result, zval *s1, zval *s2)
if (use_copy2) {
zval_dtor(s2);
}
return;
return;
}
@ -2448,9 +2448,9 @@ ZEND_API void zend_locale_usprintf_double(zval *op ZEND_FILE_LINE_DC)
ZEND_API void zend_locale_sprintf_double(zval *op ZEND_FILE_LINE_DC)
{
double dval = Z_DVAL_P(op);
TSRMLS_FETCH();
Z_STRVAL_P(op) = (char *) emalloc_rel(MAX_LENGTH_OF_DOUBLE + EG(precision) + 1);
sprintf(Z_STRVAL_P(op), "%.*G", (int) EG(precision), dval);
Z_STRLEN_P(op) = strlen(Z_STRVAL_P(op));

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -78,7 +78,7 @@ static inline zend_uchar is_numeric_string(char *str, int length, long *lval, do
if (!length) {
return 0;
}
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
@ -147,7 +147,7 @@ static inline zend_uchar is_numeric_unicode(UChar *str, int32_t length, long *lv
if (!length) {
return 0;
}
/* handle hex numbers */
if (length>=2 && str[0]=='0' && (str[1]=='x' || str[1]=='X')) {
conv_base=16;
@ -222,14 +222,14 @@ zend_memnstr(char *haystack, char *needle, int needle_len, char *end)
return p;
}
}
if (p == NULL) {
return NULL;
}
p++;
}
return NULL;
}
@ -406,7 +406,7 @@ END_EXTERN_C()
#define Z_OBJVAL_P(zval_p) Z_OBJVAL(*zval_p)
#define Z_OBJ_HANDLE_P(zval_p) Z_OBJ_HANDLE(*zval_p)
#define Z_OBJ_HT_P(zval_p) Z_OBJ_HT(*zval_p)
#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
#define Z_OBJ_HANDLER_P(zval_p, h) Z_OBJ_HANDLER(*zval_p, h)
#define Z_UNIVAL_P(zval_p) Z_UNIVAL(*zval_p)
#define Z_UNILEN_P(zval_p) Z_UNILEN(*zval_p)
@ -425,7 +425,7 @@ END_EXTERN_C()
#define Z_OBJVAL_PP(zval_pp) Z_OBJVAL(**zval_pp)
#define Z_OBJ_HANDLE_PP(zval_p) Z_OBJ_HANDLE(**zval_p)
#define Z_OBJ_HT_PP(zval_p) Z_OBJ_HT(**zval_p)
#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h)
#define Z_OBJ_HANDLER_PP(zval_p, h) Z_OBJ_HANDLER(**zval_p, h)
#define Z_UNIVAL_PP(zval_pp) Z_UNIVAL(**zval_pp)
#define Z_UNILEN_PP(zval_pp) Z_UNILEN(**zval_pp)

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -37,7 +37,7 @@ ZEND_API void zend_ptr_stack_n_push(zend_ptr_stack *stack, int count, ...)
{
va_list ptr;
void *elem;
ZEND_PTR_STACK_RESIZE_IF_NEEDED(stack, count)
va_start(ptr, count);
@ -55,7 +55,7 @@ ZEND_API void zend_ptr_stack_n_pop(zend_ptr_stack *stack, int count, ...)
{
va_list ptr;
void **elem;
va_start(ptr, count);
while (count>0) {
elem = va_arg(ptr, void **);

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -85,10 +85,10 @@ ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t co
for (; seg2 >= seg1 && compare(seg2, begin TSRMLS_CC) > 0;
seg2 -= siz);
if (seg1 >= seg2)
break;
_zend_qsort_swap(seg1, seg2, siz);
seg1 += siz;
@ -98,7 +98,7 @@ ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t co
_zend_qsort_swap(begin, seg2, siz);
seg2p = seg2;
if ((seg2p - begin) <= (end - seg2p)) {
if ((seg2p + siz) < end) {
begin_stack[loop] = seg2p + siz;
@ -117,9 +117,9 @@ ZEND_API void zend_qsort(void *base, size_t nmemb, size_t siz, compare_func_t co
}
}
/*
/*
* Local Variables:
* c-basic-offset: 4
* c-basic-offset: 4
* tab-width: 4
* End:
* vim600: fdm=marker

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -51,7 +51,7 @@ ZEND_API int zend_stream_open(const char *filename, zend_file_handle *handle TSR
handle->handle.fp = zend_fopen(filename, &handle->opened_path);
handle->filename = (char *)filename;
handle->free_filename = 0;
return (handle->handle.fp) ? SUCCESS : FAILURE;
}
@ -63,20 +63,20 @@ ZEND_API int zend_stream_fixup(zend_file_handle *file_handle TSRMLS_DC)
return FAILURE;
}
break;
case ZEND_HANDLE_FD:
file_handle->handle.fp = fdopen(file_handle->handle.fd, "rb");
file_handle->type = ZEND_HANDLE_FP;
break;
case ZEND_HANDLE_FP:
file_handle->handle.fp = file_handle->handle.fp;
break;
case ZEND_HANDLE_STREAM:
/* nothing to do */
return SUCCESS;
default:
return FAILURE;
}
@ -100,7 +100,7 @@ ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_
{
if (file_handle->handle.stream.interactive) {
int c = '*';
size_t n;
size_t n;
#ifdef NETWARE
/*
@ -110,11 +110,11 @@ ZEND_API size_t zend_stream_read(zend_file_handle *file_handle, char *buf, size_
*/
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != 4 && c != '\n'; ++n )
#else
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n )
for ( n = 0; n < len && (c = zend_stream_getc( file_handle TSRMLS_CC)) != EOF && c != '\n'; ++n )
#endif
buf[n] = (char) c;
buf[n] = (char) c;
if ( c == '\n' )
buf[n++] = (char) c;
buf[n++] = (char) c;
return n;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -61,4 +61,3 @@ END_EXTERN_C()
#define zend_stream_close(handle) zend_file_handle_dtor((handle))
#endif

View File

@ -1778,7 +1778,7 @@ zend_strtod
if (se)
*se = (char *)s;
result = sign ? -value(rv) : value(rv);
for (i = 0; i <= Kmax; i++) {
Bigint **listp = &freelist[i];
while ((tmp = *listp) != NULL) {
@ -1787,13 +1787,13 @@ zend_strtod
}
freelist[i] = NULL;
}
while (p5s) {
tmp = p5s;
p5s = p5s->next;
free(tmp);
}
return result;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -43,14 +43,14 @@ static void zend_from_unicode_substitute_cb(
{
return;
}
*err = U_ZERO_ERROR;
//ucnv_cbFromUWriteSub(fromArgs, 0, err);
return;
} else if (*((char*)context)=='i') {
if (reason != UCNV_UNASSIGNED)
{
/* the caller must have set
/* the caller must have set
* the error code accordingly
*/
return;
@ -143,7 +143,7 @@ int zend_set_converter_encoding(UConverter **converter, const char *encoding)
}
/*
* If encoding is NULL, ucnv_open() will return a converter based on
* If encoding is NULL, ucnv_open() will return a converter based on
* the default platform encoding as determined by ucnv_getDefaultName().
*/
new_converter = ucnv_open(encoding, &status);
@ -309,7 +309,7 @@ ZEND_API void zend_convert_encodings(UConverter *target_conv, UConverter *source
if (U_FAILURE(*status)) {
return;
}
null_size = ucnv_getMinCharSize(target_conv);
allocated = source_len + null_size;
@ -493,7 +493,7 @@ ZEND_API int zend_is_valid_identifier(UChar *ident, int32_t ident_len)
for (i = 0; i < ident_len; ) {
U16_NEXT(ident, i, ident_len, codepoint);
if (!u_hasBinaryProperty(codepoint, id_prop) &&
if (!u_hasBinaryProperty(codepoint, id_prop) &&
codepoint != 0x5f) { /* special case for starting '_' */
return 0;
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |
@ -171,7 +171,7 @@ copy_unicode:
}
}
ZEND_API int zend_print_variable(zval *var)
ZEND_API int zend_print_variable(zval *var)
{
return zend_print_zval(var, 0);
}

View File

@ -5,7 +5,7 @@
| Copyright (c) 1998-2006 Zend Technologies Ltd. (http://www.zend.com) |
+----------------------------------------------------------------------+
| This source file is subject to version 2.00 of the Zend license, |
| that is bundled with this package in the file LICENSE, and is |
| that is bundled with this package in the file LICENSE, and is |
| available through the world-wide-web at the following url: |
| http://www.zend.com/license/2_00.txt. |
| If you did not receive a copy of the Zend license and are unable to |

View File

@ -1106,7 +1106,7 @@ ZEND_VM_HANDLER(93, ZEND_FETCH_DIM_FUNC_ARG, VAR|CV, CONST|TMP|VAR|UNUSED|CV)
zend_free_op free_op1, free_op2;
int type = ARG_SHOULD_BE_SENT_BY_REF(EX(fbc), opline->extended_value)?BP_VAR_W:BP_VAR_R;
zval *dim;
if (OP2_TYPE == IS_UNUSED && type == BP_VAR_R) {
zend_error_noreturn(E_ERROR, "Cannot use [] for reading");
}
@ -1414,7 +1414,7 @@ ZEND_VM_HANDLER(39, ZEND_ASSIGN_REF, VAR|CV, VAR|CV)
if (OP2_TYPE == IS_VAR &&
value_ptr_ptr &&
!(*value_ptr_ptr)->is_ref &&
opline->extended_value == ZEND_RETURNS_FUNCTION &&
opline->extended_value == ZEND_RETURNS_FUNCTION &&
!EX_T(opline->op2.u.var).var.fcall_returned_reference) {
if (free_op2.var == NULL) {
PZVAL_LOCK(*value_ptr_ptr); /* undo the effect of get_zval_ptr_ptr() */
@ -1820,7 +1820,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
ZEND_VM_NEXT_OPCODE(); /* Never reached */
}
if (EX(function_state).function->common.fn_flags & ZEND_ACC_DEPRECATED) {
zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
zend_error(E_NOTICE, "Function %s%s%s() is deprecated",
EX(function_state).function->common.scope ? EX(function_state).function->common.scope->name : "",
EX(function_state).function->common.scope ? "::" : "",
EX(function_state).function->common.function_name);
@ -2230,8 +2230,8 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
if ((!(opline->extended_value & ZEND_ARG_SEND_FUNCTION) ||
EX_T(opline->op1.u.var).var.fcall_returned_reference) &&
varptr != &EG(uninitialized_zval) &&
(PZVAL_IS_REF(varptr) ||
varptr != &EG(uninitialized_zval) &&
(PZVAL_IS_REF(varptr) ||
(varptr->refcount == 1 && (OP1_TYPE == IS_CV || free_op1.var)))) {
varptr->is_ref = 1;
varptr->refcount++;
@ -2467,7 +2467,7 @@ ZEND_VM_HANDLER(68, ZEND_NEW, ANY, ANY)
SELECTIVE_PZVAL_LOCK(object_zval, &opline->result);
EX_T(opline->result.u.var).var.ptr_ptr = &EX_T(opline->result.u.var).var.ptr;
EX_T(opline->result.u.var).var.ptr = object_zval;
zend_ptr_stack_3_push(&EG(arg_types_stack), EX(fbc), EX(object), opline);
/* We are not handling overloaded classes right now */
@ -2861,9 +2861,9 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, ANY)
if (opline->op2.u.EA.type == ZEND_FETCH_STATIC_MEMBER) {
zend_std_unset_static_property(EX_T(opline->op2.u.var).class_entry, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname) TSRMLS_CC);
} else {
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
target_symbol_table = zend_get_target_symbol_table(opline, EX(Ts), BP_VAR_IS, varname TSRMLS_CC);
if (zend_u_hash_del(target_symbol_table, Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1) == SUCCESS) {
zend_execute_data *ex = EXECUTE_DATA;
zend_execute_data *ex = EXECUTE_DATA;
ulong hash_value = zend_u_inline_hash_func(Z_TYPE_P(varname), Z_UNIVAL_P(varname), Z_UNILEN_P(varname)+1);
do {
@ -2940,7 +2940,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
free_offset = 1;
}
}
if (zend_u_symtable_del(ht, Z_TYPE_P(offset), offset_key, offset_len+1) == SUCCESS &&
ht == &EG(symbol_table)) {
zend_execute_data *ex;
@ -3057,7 +3057,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET, CONST|TMP|VAR|CV, ANY)
zend_error(E_WARNING, "foreach() can not iterate over objects without PHP class");
ZEND_VM_JMP(EX(op_array)->opcodes+opline->op2.u.opline_num);
}
ce = Z_OBJCE_PP(array_ptr_ptr);
if (!ce || ce->get_iterator == NULL) {
SEPARATE_ZVAL_IF_NOT_REF(array_ptr_ptr);
@ -3550,13 +3550,13 @@ ZEND_VM_HANDLER(79, ZEND_EXIT, CONST|TMP|VAR|UNUSED|CV, ANY)
ZEND_VM_HANDLER(57, ZEND_BEGIN_SILENCE, ANY, ANY)
{
zend_op *opline = EX(opline);
Z_LVAL(EX_T(opline->result.u.var).tmp_var) = EG(error_reporting);
Z_TYPE(EX_T(opline->result.u.var).tmp_var) = IS_LONG; /* shouldn't be necessary */
if (EX(old_error_reporting) == NULL) {
EX(old_error_reporting) = &EX_T(opline->result.u.var).tmp_var;
}
if (EG(error_reporting)) {
zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), "0", 1, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME);
}
@ -3752,7 +3752,7 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
zendi_zval_dtor(restored_error_reporting);
}
EX(old_error_reporting) = NULL;
if (encapsulating_block == -1) {
ZEND_VM_RETURN_FROM_EXECUTE_LOOP();
} else {
@ -3768,7 +3768,7 @@ ZEND_VM_HANDLER(146, ZEND_VERIFY_ABSTRACT_CLASS, ANY, ANY)
}
ZEND_VM_HANDLER(150, ZEND_USER_OPCODE, ANY, ANY)
{
{
int ret = zend_user_opcode_handlers[EX(opline)->opcode](ZEND_OPCODE_HANDLER_ARGS_PASSTHRU_INTERNAL);
switch (ret) {

File diff suppressed because it is too large Load Diff

View File

@ -52,7 +52,7 @@ ZEND_API void {%EXECUTOR_NAME%}(zend_op_array *op_array TSRMLS_DC)
*/
EX(function_state).function_symbol_table = NULL;
#endif
while (1) {
{%ZEND_VM_CONTINUE_LABEL%}
#ifdef ZEND_WIN32

View File

@ -456,6 +456,9 @@ function gen_code($f, $spec, $kind, $code, $op1, $op2) {
/* Remove unnecessary ';' */
$code = preg_replace('/^\s*;\s*$/m', '', $code);
/* Remove WS */
$code = preg_replace('/[ \t]+\n/m', "\n", $code);
out($f, $code);
}
@ -581,7 +584,7 @@ function gen_labels($f, $spec, $kind, $prolog) {
// Try to use unspecialized handler
$op2 = "ANY";
}
// Check if specialized handler is defined
// Check if specialized handler is defined
if (isset($dsc["op1"][$op1]) &&
isset($dsc["op2"][$op2])) {
// Emit pointer to specialized handler
@ -670,7 +673,7 @@ function gen_labels($f, $spec, $kind, $prolog) {
function gen_null_handler($f) {
static $done = 0;
// New and all executors with CALL threading model can use the same handler
// New and all executors with CALL threading model can use the same handler
// for undefined opcodes, do we emit code for it only once
if (!$done) {
$done = 1;
@ -689,10 +692,10 @@ function gen_executor_code($f, $spec, $kind, $prolog) {
if ($spec) {
// Produce specialized executor
$op1t = $op_types;
// for each op1.op_type
// for each op1.op_type
foreach($op1t as $op1) {
$op2t = $op_types;
// for each op2.op_type
// for each op2.op_type
foreach($op2t as $op2) {
// for each handlers in helpers in original order
foreach ($list as $lineno => $dsc) {
@ -1068,7 +1071,7 @@ function gen_vm($def, $skel) {
$code_len = strlen((string)$max_opcode);
$f = fopen("zend_vm_opcodes.h", "w+") or die("ERROR: Cannot create zend_vm_opcodes.h\n");
// Insert header
// Insert header
out($f, $GLOBALS['header_text']);
foreach ($opcodes as $code => $dsc) {
@ -1083,7 +1086,7 @@ function gen_vm($def, $skel) {
$f = fopen("zend_vm_execute.h", "w+") or die("ERROR: Cannot create zend_vm_execute.h\n");
$executor_file = realpath("zend_vm_execute.h");
// Insert header
// Insert header
out($f, $GLOBALS['header_text']);
// Support for ZEND_USER_OPCODE
@ -1158,8 +1161,8 @@ function gen_vm($def, $skel) {
out($f, "}\n\n");
// Export handlers and helpers
if (count($export) > 0 &&
!ZEND_VM_OLD_EXECUTOR &&
if (count($export) > 0 &&
!ZEND_VM_OLD_EXECUTOR &&
ZEND_VM_KIND != ZEND_VM_KIND_CALL) {
out($f,"#undef EX\n");
out($f,"#define EX(element) execute_data->element\n\n");