diff --git a/Zend/zend_closures.c b/Zend/zend_closures.c index 9d5971fac479..c7279ea36e70 100644 --- a/Zend/zend_closures.c +++ b/Zend/zend_closures.c @@ -571,9 +571,9 @@ ZEND_API const zend_function *zend_get_closure_method_def(zend_object *obj) /* { } /* }}} */ -ZEND_API zend_object* zend_get_closure_this_ptr(zval *obj) /* {{{ */ +ZEND_API zend_object* zend_get_closure_this_ptr(zend_object *closure_zobj) /* {{{ */ { - zend_closure *closure = (zend_closure *)Z_OBJ_P(obj); + zend_closure *closure = (zend_closure *)closure_zobj; return closure->this_ptr; } /* }}} */ @@ -982,17 +982,17 @@ void zend_closure_from_frame(zval *return_value, const zend_execute_data *call) } } /* }}} */ -void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var) /* {{{ */ +void zend_closure_bind_var(zend_object *closure_zobj, zend_string *var_name, zval *var) /* {{{ */ { - zend_closure *closure = (zend_closure *) Z_OBJ_P(closure_zv); + zend_closure *closure = (zend_closure *) closure_zobj; HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); zend_hash_update(static_variables, var_name, var); } /* }}} */ -void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val) /* {{{ */ +void zend_closure_bind_var_ex(zend_object *closure_zobj, uint32_t offset, zval *val) /* {{{ */ { - zend_closure *closure = (zend_closure *) Z_OBJ_P(closure_zv); + zend_closure *closure = (zend_closure *) closure_zobj; HashTable *static_variables = ZEND_MAP_PTR_GET(closure->func.op_array.static_variables_ptr); zval *var = (zval*)((char*)static_variables->arData + offset); zval_ptr_dtor(var); diff --git a/Zend/zend_closures.h b/Zend/zend_closures.h index c421c100833a..051bffe98eb2 100644 --- a/Zend/zend_closures.h +++ b/Zend/zend_closures.h @@ -28,8 +28,8 @@ BEGIN_EXTERN_C() ((zend_object*)((char*)(op_array) - sizeof(zend_object))) void zend_register_closure_ce(void); -void zend_closure_bind_var(zval *closure_zv, zend_string *var_name, zval *var); -void zend_closure_bind_var_ex(zval *closure_zv, uint32_t offset, zval *val); +void zend_closure_bind_var(zend_object *closure_zobj, zend_string *var_name, zval *var); +void zend_closure_bind_var_ex(zend_object *closure_zobj, uint32_t offset, zval *val); void zend_closure_from_frame(zval *closure_zv, const zend_execute_data *frame); extern ZEND_API zend_class_entry *zend_ce_closure; @@ -39,7 +39,7 @@ ZEND_API void zend_create_fake_closure(zval *res, zend_function *op_array, zend_ ZEND_API void zend_create_partial_closure(zval *res, zend_function *func, zend_class_entry *scope, zend_class_entry *called_scope, zend_object *this_ptr, bool partial_of_closure); ZEND_API zend_function *zend_get_closure_invoke_method(zend_object *obj); ZEND_API const zend_function *zend_get_closure_method_def(zend_object *obj); -ZEND_API zend_object* zend_get_closure_this_ptr(zval *obj); +ZEND_API zend_object* zend_get_closure_this_ptr(zend_object *closure_zobj); END_EXTERN_C() diff --git a/Zend/zend_partial.c b/Zend/zend_partial.c index e938f53cc3cf..fa73560e31a6 100644 --- a/Zend/zend_partial.c +++ b/Zend/zend_partial.c @@ -1087,7 +1087,7 @@ static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval * zval var; ZVAL_OBJ(&var, ZEND_CLOSURE_OBJECT(function)); Z_ADDREF(var); - zend_closure_bind_var_ex(result, bind_offset, &var); + zend_closure_bind_var_ex(Z_OBJ_P(result), bind_offset, &var); bind_offset += sizeof(Bucket); } @@ -1119,7 +1119,7 @@ static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval * return; } ZEND_ASSERT(zp_arg_must_be_sent_by_ref(function, offset+1) ? Z_ISREF_P(var) : !Z_ISREF_P(var)); - zend_closure_bind_var_ex(result, bind_offset, var); + zend_closure_bind_var_ex(Z_OBJ_P(result), bind_offset, var); bind_offset += sizeof(Bucket); } @@ -1127,7 +1127,7 @@ static void zp_bind(zval *result, zend_function *function, uint32_t argc, zval * zval var; ZVAL_ARR(&var, extra_named_params); Z_ADDREF(var); - zend_closure_bind_var_ex(result, bind_offset, &var); + zend_closure_bind_var_ex(Z_OBJ_P(result), bind_offset, &var); } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index d1355208c287..b01d7287c53f 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -9248,7 +9248,7 @@ ZEND_VM_HANDLER(182, ZEND_BIND_LEXICAL, TMP, CV, REF) Z_TRY_ADDREF_P(var); } - zend_closure_bind_var_ex(closure, + zend_closure_bind_var_ex(Z_OBJ_P(closure), (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT)), var); ZEND_VM_NEXT_OPCODE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index fe2df85c23e3..352e6d9f6924 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -23276,7 +23276,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_FUNC_CCONV ZEND_BIND_LEXICAL_ Z_TRY_ADDREF_P(var); } - zend_closure_bind_var_ex(closure, + zend_closure_bind_var_ex(Z_OBJ_P(closure), (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT)), var); ZEND_VM_NEXT_OPCODE(); } @@ -75935,7 +75935,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_OPCODE_HANDLER_CCONV ZEND_BIND_LEXICAL_SPEC_ Z_TRY_ADDREF_P(var); } - zend_closure_bind_var_ex(closure, + zend_closure_bind_var_ex(Z_OBJ_P(closure), (opline->extended_value & ~(ZEND_BIND_REF|ZEND_BIND_IMPLICIT)), var); ZEND_VM_NEXT_OPCODE(); } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index b1968d9ff118..c140109dae28 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -1779,7 +1779,7 @@ ZEND_METHOD(ReflectionFunctionAbstract, getClosureThis) GET_REFLECTION_OBJECT(); if (!Z_ISUNDEF(intern->obj)) { - zend_object *closure_this = zend_get_closure_this_ptr(&intern->obj); + zend_object *closure_this = zend_get_closure_this_ptr(Z_OBJ(intern->obj)); if (closure_this) { RETURN_OBJ_COPY(closure_this); }