diff options
author | Anatol Belski <ab@php.net> | 2014-07-01 09:10:36 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-07-01 09:10:36 +0200 |
commit | 1a50c27f998769c5b3472d35c39852286900db69 (patch) | |
tree | 3c83075a87d566d3d2cac23523ce3f737805aa32 /Zend/zend_vm_execute.h | |
parent | d4cfc15514285d42f113facc1c296d32a818ccf2 (diff) | |
parent | 2330be5641c907b7edd7cffdd3074e85d0091df5 (diff) | |
download | php-git-1a50c27f998769c5b3472d35c39852286900db69.tar.gz |
Merge remote-tracking branch 'origin/PHP-5.6' into str_size_and_int64_56_backport
* origin/PHP-5.6: (170 commits)
Fixed possible crash because of race conditions on modifying constants in shared memory
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
remove the NEWS entry for the reverted fpm fix
Revert "Fix Bug #67530 error_log=syslog ignored"
--enable-fpm for the travis build
fix the last fpm NEWS entry, the other bug is related, but not the same what we fixed here
NEWS
NEWS
Fix bug #67091: make install fails to install libphp5.so on FreeBSD 10.0
adding NEWS entry for the fix for bug #65641
Updated NEWS file for recent phpdbg fixes
Fixed issue krakjoe/phpdbg#94 - List behavior is inconsistent
Fix issue krakjoe/phpdbg#97 - list now appends a newline if there is none The prompt should always ensure it is on a newline
Fixed test
Inform about back command existence in help - Fixes krakjoe/phpdbg#100 No way to list the current stack/frames
Fix issue krakjoe/phpdbg#98 break if does not seem to work
Fix issue krakjoe/phpdbg#99 register function has the same behavior as run
Fix readline/libedit (Thanks to @remicollet)
Replace incorrect `E` command with `ev` in watch help
...
Conflicts:
Zend/zend_compile.c
ext/standard/basic_functions.c
ext/standard/http_fopen_wrapper.c
ext/standard/var.c
ext/tokenizer/tokenizer_data.c
sapi/phpdbg/phpdbg_list.c
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r-- | Zend/zend_vm_execute.h | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index ab2fb9dd8b..22d400720f 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1624,6 +1624,13 @@ static int ZEND_FASTCALL ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ if (IS_CONSTANT_TYPE(Z_TYPE_P(assignment_value))) { Z_SET_REFCOUNT_P(assignment_value, 1); zval_update_constant(&assignment_value, 0 TSRMLS_CC); + } else if (Z_TYPE_P(assignment_value) == IS_ARRAY) { + HashTable *ht; + + ALLOC_HASHTABLE(ht); + zend_hash_init(ht, zend_hash_num_elements(Z_ARRVAL_P(assignment_value)), NULL, ZVAL_PTR_DTOR, 0); + zend_hash_copy(ht, Z_ARRVAL_P(assignment_value), (copy_ctor_func_t) zval_deep_copy, NULL, sizeof(zval *)); + Z_ARRVAL_P(assignment_value) = ht; } else { zval_copy_ctor(assignment_value); } @@ -6781,6 +6788,7 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER { USE_OPLINE zend_function *op_array; + int closure_is_static, closure_is_being_defined_inside_static_context; SAVE_OPLINE(); @@ -6789,7 +6797,13 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER zend_error_noreturn(E_ERROR, "Base lambda function for closure not found"); } - zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC); + closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC; + closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC; + if (closure_is_static || closure_is_being_defined_inside_static_context) { + zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC); + } else { + zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC); + } CHECK_EXCEPTION(); ZEND_VM_NEXT_OPCODE(); @@ -9306,7 +9320,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CONST_HANDLER(ZEND_OPCO HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -10171,7 +10185,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_TMP_HANDLER(ZEND_OPCODE zval_dtor(free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -11037,7 +11051,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -12483,7 +12497,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMP_CV_HANDLER(ZEND_OPCODE_ HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -15721,7 +15735,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZEND_OPCO HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -18067,7 +18081,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE zval_dtor(free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -20374,7 +20388,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -23831,7 +23845,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_ HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -25473,7 +25487,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -26881,7 +26895,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC zval_dtor(free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -28195,7 +28209,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -29937,7 +29951,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -33176,7 +33190,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST_HANDLER(ZEND_OPCOD HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -35288,7 +35302,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_ zval_dtor(free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -37455,7 +37469,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_VAR_HANDLER(ZEND_OPCODE_ zval_ptr_dtor_nogc(&free_op2.var); HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { @@ -40623,7 +40637,7 @@ static int ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HANDLER(ZEND_OPCODE_H HANDLE_EXCEPTION(); } - zend_error_noreturn(E_ERROR, "Call to a member function %s() on a non-object", function_name_strval); + zend_error_noreturn(E_ERROR, "Call to a member function %s() on %s", function_name_strval, zend_get_type_by_const(Z_TYPE_P(call->object))); } if ((call->fbc->common.fn_flags & ZEND_ACC_STATIC) != 0) { |