diff options
author | Marcus Boerger <helly@php.net> | 2007-04-06 16:00:08 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2007-04-06 16:00:08 +0000 |
commit | b08cfa8833101ad70b82bbceae75fe0131493a9c (patch) | |
tree | 37433c29fa9a4ffeae2c15ca86a7f1fb5fa05db3 /ext/spl/php_spl.c | |
parent | 17eaaea1f7c16b6012a0fadef821dcc302dd13bf (diff) | |
download | php-git-b08cfa8833101ad70b82bbceae75fe0131493a9c.tar.gz |
- Better fix for #40091
Diffstat (limited to 'ext/spl/php_spl.c')
-rwxr-xr-x | ext/spl/php_spl.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index 98afefa9f8..92bf17c56b 100755 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -449,13 +449,13 @@ PHP_FUNCTION(spl_autoload_register) efree(func_name); if (SPL_G(autoload_functions) && zend_hash_exists(SPL_G(autoload_functions), (char*)lc_name, func_name_len+1)) { - goto skip; + goto skip; } if (obj_ptr && !(alfi.func_ptr->common.fn_flags & ZEND_ACC_STATIC)) { /* add object id to the hash to ensure uniqueness, for more reference look at bug #40091 */ - memcpy(lc_name + func_name_len, obj_ptr, sizeof(long)); - func_name_len += sizeof(long); + memcpy(lc_name + func_name_len, &Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); + func_name_len += sizeof(zend_object_handle); lc_name[func_name_len] = '\0'; alfi.obj = *obj_ptr; alfi.obj->refcount++; @@ -528,9 +528,9 @@ PHP_FUNCTION(spl_autoload_unregister) /* remove specific */ success = zend_hash_del(SPL_G(autoload_functions), func_name, func_name_len+1); if (success != SUCCESS && obj_ptr) { - func_name = erealloc(func_name, func_name_len + 1 + sizeof(long)); - memcpy(func_name + func_name_len, obj_ptr, sizeof(long)); - func_name_len += sizeof(long); + func_name = erealloc(func_name, func_name_len + 1 + sizeof(zend_object_handle)); + memcpy(func_name + func_name_len, &Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle)); + func_name_len += sizeof(zend_object_handle); func_name[func_name_len] = '\0'; success = zend_hash_del(SPL_G(autoload_functions), func_name, func_name_len+1); } |