If multiple unpacks were used (or mixed with normal arguments)
parts of the arguments could land on different stack pages. If
this occurs the arguments will now be copied to a new stack page.
The code used to do this is copied verbatim from the PHP 5.4 branch
and only modified to reduce the amount of inlined code.
* pull-request/500:
limit virtual_cwd_activate() duplicated call to ZTS only
reverted the previous commit, both calls are needed in TS mode
virtual_cwd_activate() should be called only in one place
back to do_alloca()
removed unnecessary call
simplify the state free macros
compact the code to preserve the error info after state freeing
back to do_alloca(), reverted the wrong replacement
enabled windows to use stack in both ts/nts mode, some more fixes
moved to do_alloca() usage where appropriate
fixed invalid free
fixed virtual cwd header in phar
updated NEWS
fixed all the places where last error could be lost
preserve the error code
applied and fixed the original patch
initial move on renaming files and fixing includes
Conflicts:
ext/opcache/ZendAccelerator.c
* str_erealloc behaves like erealloc for normal strings, but will
use emalloc+memcpy for interned strings.
* str_estrndup behaves like estrndup for normal strings, but will
not copy interned strings.
* str_strndup behaves like zend_strndup for normal strings, but
will not copy interned strings.
* str_efree_rel behaves like efree_rel for normal strings, but
will not free interned strings.
* str_hash will return INTERNED_HASH for interned strings and
compute it using zend_hash_func for normal strings.
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.
This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:
RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */
These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
This is just an intial merge. It does not yet make generators and finally
work together.
Conflicts:
Zend/zend_language_scanner.c
Zend/zend_language_scanner_defs.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl
Zend/zend_vm_opcodes.h
To make the generator function show up in backtraces one has to insert an
additional execute_data into the chain, as prev_execute_data->function_state
is used to determine the called function.
Adding the additional stack frame is also required for func_get_args(), as
the arguments are fetched from there too. The arguments have to be copied
in order to keep them around. Due to the way they are saved doing so is
quite ugly, so I added another function zend_copy_arguments to zend_execute.c
which handles this.
To keep things clean two new functions are introduced:
zend_clean_and_cache_symbol_table(HashTable *symbol_table)
zend_free_compiled_variables(zval ***CVs, int num)
* PHP-5.3:
Fixed Bug #62005 (unexpected behavior when incrementally assigning to a member of a null object)
fix stack overflow in php_intlog10abs()
Conflicts:
Zend/zend_execute.c