Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
That's the same as in the previous commit. In the TS mode the tsrm
cache pointer might be unavailable or point to a wrong thread, so
the exact globals passed should be freed.
* origin/master:
updated NEWS
PowerPC64 support for add and sub with overflow check
PowerPC64 support for operators with overflow check
Fixed bug #68583 Crash in timeout thread
Reduced size of zend_op on 64-bit systems.
Make ZEND_INIT_FCALL keep predcalculted size of necessary stack space in opline->op1.num to avoid its recalculation on each execution.
Removed unused variables
Improved array_merge() and array_replace() (1-st array may be added using simple procedure).
Replaced zendi_convert_to_long() with _zval_get_long_func()
Moved zend_is_true() from zend_execute.h/zend_execute_API.c into zend_operators.h/zend_operators.c. Splited the most expensive part of inline i_zend_is_true() into a separate zend_object_is_true(). Replaced zendi_convert_to_long() with cals to zend_is_true().
Revert "Save one xor instr"
Save one xor instr
Conflicts:
Zend/zend_execute_API.c
This replaces the GUI element used for execution timeout handling
on Windows. Instead a timer queue technique is used, which is indeed
a thread pool. A timer queue timer is a lightweight object handled
but that thread pool and the timer thread spends most of the time
sleeping and waiting for an alert.
Please note also that this introduces neither binary nor source
breach. The custom timeout thread functions are deleted, however
they was not exported throug DLL, so couldn't be used by any
external code. As well they couldn't be used anywhere in the core
except in executor api, because those custom timeout thread
functions they used to operate on static variables which would
be overwritten (and that would blow).
So instead a relatively modern technique is used for the timeout
handling. It's still not perfect because the executor still has to
check EX(timed_out). This can be a topic for an improvement in
master. But brobably can be tricky as currently it seems to be not
possible to signal an individual thread. Also note another issue
that static variables aren't thread safe, but the current timer
implementation is.
* origin/master: (214 commits)
fix datatype mismatch warnings
fix datatype mismatches
fix datatype mismatches
fix datatype mismatches
fix datatype mismatch warnings
fix datatype mismatch warnings
fix datatype mismatch warnings
fix datatype mismatch warning
fix datatype mismatches
fix datatype mismatch warnings
Re-add phpdbg to travis
Added some NEWS
Make xml valid (missing space between attrs)
Fix info classes file name in xml
Add note about <eval> tag for errors in xml.md
Name the tag <eval> if the error id during ev cmd
Do not print out xml as PHP print...
Fix output to wrong function
Fixed parameter order on %.*s
Too much copypaste...
...
* origin/master:
We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.
Ensure __LINE__ is always accurate
Fix incdec of referenced properties
Fix ::jsonSerialize() failure message
Fix invalid zend_string_frees in reflection
Remove retval member in spl_dllist
DLL export several APIs needed for phpdbg
More fixes for nodelist array access - testing for null property read - no zval copying if the type is already long - memory fix for master
* origin/master: (40 commits)
int to size_t where the underlaying API supports it
use php_socket_t instead of int
fix signed/unsigned mismatch warning
fix compilation warning
Improved specialisation $this variable accessed through IS_UNUSED operand must be IS_OBJECT, so we don't have to check for its type or perform dereference.
Add notes about get_class_entry/get_class_name to UPGRADING
Fix casts in GD
Drop redundant casting code from ext/filter
update NEWS
update NEWS
update NEWS
update NEWS
Added note to UPGRADING regarding 64-bit support in pack()/unpack()
pack(): Use SIZEOF_ZEND_LONG instead of SIZEOF_LONG
Add 64 bit formats to pack() and unpack()
Help to CPU branch predictor
Removed unused EG(orig_error_reporting)
Update get_class_name semantics
Remove Z_OBJ_CLASS_NAME_P
Improved VM stack primitives for fast paths. Slow paths are not inlined anymore.
...
* get_class_name is now only used for displaying the class name
in debugging functions like var_dump, print_r, etc. It is no
longer used in get_class() etc.
* As it is no longer used in get_parent_class() the parent
argument is now gone. This also fixes incorrect parent classes
being reported in COM.
* get_class_name is now always required (previously some places
made it optional and some required it) and is also required
to return a non-NULL value.
* Remove zend_get_object_classname. This also fixes a number of
potential leaks due to incorrect usage of this function.
* origin/master:
bring back the correct php_version.h
fix the empty_strings SAPI shutdown leak in TS build
Use fastcall calling convention for heap functions
fix leaking the empty_string in TS builds
remove successive assignment
still the NTS variant is somewhat different as it needs
zend_new_interned_string_int because the normal callbacks might
be not initialized, but at least no leaks anymore and some more
structure
* origin/master: (42 commits)
Add tests verifying calls work inside echo, concatenation and array access
Updated NEWS and UPGRADING
Fix $this CV init for include/eval
Fix dynamic calls to static methods with fci->object
Fix $arr =& $arr[0]
Add UPGRADING stubs for a number of recent changes
Regenerate tokenizer data
Fix unused variable warning
Remove <% and <script language="php"> tags
zend_uint -> uint32_t
Fix nesting for *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414223)
Add tests for calls to nested, *non*-compile-time-resolveable functions See a1a4ba9511 (commitcomment-7414362)
Make list of opcodes used for nesting calculation consistent with `zend_do_convert_call_user_func()` in Zend/zend_compile.c
Rewrite code to use ZEND_VM_JMP() instead of repeated ZEND_VM_INC_OPCODE() calls
QA: Simplify code to find matching ZEND_DO_FCALL_BY_NAME CG(context).nested_calls is stored inside the initializer's result.num and inside the finalizer's op2.num, by comparing these we don't need to count manually, and are thus safer from future expansion with specialized opcodes e.g.
Fix expected fatal error, now is catchable fatal
Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
Check for memory leaks when not using return value
Adjust expected fatal error message Now also includes "on [TYPE]" after merge from master
Add tests with arrays as parameters
...
As per https://wiki.php.net/rfc/remove_alternative_php_tags.
Removes:
* <% opening tag
* %> closing tag
* <%= short opening tag
* /<script\s+language\s*=\s*(php|"php"|'php')\s*>/i opening tag
* /</script>/i closing tag
* asp_tags ini directive
TLS is already used in TSRM, the way exporting the tsrm cache through
a thread local variable is not portable. Additionally, the current
patch suffers from bugs which are hard to find, but prevent it to
be worky with apache. What is done here is mainly uses the idea
from the RFC patch, but
- __thread variable is removed
- offset math and declarations are removed
- extra macros and definitions are removed
What is done merely is
- use an inline function to access the tsrm cache. The function uses
the portable tsrm_tls_get macro which is cheap
- all the TSRM_* macros are set to placebo. Thus this opens the way
remove them later
Except that, the logic is old. TSRMLS_FETCH will have to be done once
per thread, then tsrm_get_ls_cache() can be used. Things seeming to be
worky are cli, cli server and apache. I also tried to enable bz2
shared and it has worked out of the box. The change is yet minimal
diffing to the current master bus is a worky start, IMHO. Though will
have to recheck the other previously done SAPIs - embed and cgi.
The offsets can be added to the tsrm_resource_type struct, then
it'll not be needed to declare them in the userspace. Even the
"done" member type can be changed to int16 or smaller, then adding
the offset as int16 will not change the struct size. As well on the
todo might be removing the hashed storage, thread_id != thread_id and
linked list logic in favour of the explicit TLS operations.
* origin/master: (31 commits)
Fixed C++ incompatibility
update the certificate used for the test, as it expired recently
Fixed immutable arrays support
Fix counting of "R:" references in serialize()
Remove dead code
Test use($this) being an error
Move list() condition into assign_znode
typo
NEWS
Fix bug #68074 Allow to use system cipher list instead of hardcoded value
Avoid double checks
the order of the blocks should be Core, then exts in alphabetical order
add missing NEWS entry for the phpdbg compilation fix
add NEWS entry for #68088
Make QM_ASSIGN, JMP_SET and CAST return IS_TMP_VAR.
Removed useless helper
Drop unused result argument
Fix ct binding for cuf/cufa functions
Fix detection of write to built-in function for references
Test use of string names with \ prefix
...
- windows only, on linux gcc would cause a warning that the function returns,
as no noreturn functions are used
- ZEND_NORETURN works on windows as well now, using __declspec(noreturn),
which is useful for the other cases
- one more function call will be needed, which is not critical for the
error reporting
- the way is open to enable the same for gcc as soon as it's not causing a warning
* PHP-5.6:
update NEWS
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Fix typo from commit 32314f6b6
Fix destruction order in zend_shutdown (bug #65463, #66036)
Conflicts:
Zend/zend_compile.h
Zend/zend_execute_API.c
* PHP-5.5:
update NEWS
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Fix typo from commit 32314f6b6
Fix destruction order in zend_shutdown (bug #65463, #66036)
* PHP-5.4:
update NEWS
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Fix typo from commit 32314f6b6
Fix destruction order in zend_shutdown (bug #65463, #66036)
* pull-request/770:
Only destruct if EG(active) in zend_shutdown(). (bug #65463, #66036)
Fix typo from commit 32314f6b6
Fix destruction order in zend_shutdown (bug #65463, #66036)
Now one common stack to handle both, which stores znodes instead of
full oplines (foreach copy stack) or switch entries (switch cond
stack).
Also removed EG(start_op) while at it.
As far as I can discern these are leftovers of the interactive
shell implementation that was used before PHP 5.4. Now the readline
ext makes use of normal eval calls for this.
So, dropping these until there is evidence to the contrary, as they
currently wouldn't work anyway.
If Apache or a similar SAPI receives a signal during PHP processing
it calls zend_shutdown() without calling shutdown_executor().
#65463: If a module like Gearman or Memcached is loaded,
in the unfixed version it is unloaded by zend_destroy_modules() before the
CG(CLASS_TABLE) is destructed. When CG(CLASS_TABLE) is destructed,
any pointers to methods (specifically around destruction) in the unloaded
module's .so are now dangling and the process segfaults.
#66036: Any subclasses of an internal class like ArrayObject need
to be destructed in order: subclass first and then the internal class. In the
unfixed version zend_shutdown() clears the CG(CLASS_TABLE) from the head
of the list onwards, so internal classes are destructed first and user-defined
classes last. Internal classes are alloc/deallocated with malloc/free while
user-defined classes with emalloc/efree. If there's shared data between them
then efree() could be called instead of free() leading to a seg-fault.
This issue was originally hacked around in zend_make_printable_zval.
I've now moved the overridden __toString() handling into the SXE
cast_object handler, so everything invoking that handler
(zend_make_printable_zval, convert_to_string, zval_get_string,
and various other more obscure usages) see the same behavior.
This piece of code seems to retain compatibility with some windows
versions before 2000. Today it's not relevant anymore and only
produces a warning C4273 because of the conflicting prototype. In
VC9 the declaration is present in winbase.h:4142, but available
is it already in winxp. Here's the doc link
http://msdn.microsoft.com/en-us/library/windows/desktop/ms680345(v=vs.85).aspx
Also fixes duplicate bugs #54054 and #42098.
Furthermore this fixes incorrect error messages thrown from code
running inside an error handler when a compilation is in progress.
The error file and line are now correctly associated with the
file/line of the executor, rather than the compiler.