Commit Graph

8714 Commits

Author SHA1 Message Date
Dmitry Stogov
acfbb7b6dc Merge branch 'master' into test
* master: (67 commits)
  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
  Fix typo in `finish` help
  ...

Conflicts:
	Zend/zend_ast.c
	Zend/zend_highlight.c
	Zend/zend_indent.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/info.c
2014-07-01 00:19:41 +04:00
Dmitry Stogov
8c9b3e664c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fixed possible crash because of race conditions on modifying constants in shared memory
2014-07-01 00:17:55 +04:00
Dmitry Stogov
2330be5641 Fixed possible crash because of race conditions on modifying constants in shared memory 2014-07-01 00:13:34 +04:00
Dmitry Stogov
b7715c7e8a Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice.
Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack.
"Call frame" is actually the same zend_execute_data structure.
All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance.

There are two minor incompatibilities:
1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}".
2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
2014-06-30 15:43:45 +04:00
Xinchen Hui
7614fe810e C++ doesn't allow implicitly convert void * to other pointer type 2014-06-28 11:19:38 +08:00
Xinchen Hui
f609d8c1c6 C++ compiler doesn't allow cast a void * to other pointer type 2014-06-27 12:35:34 +08:00
Dmitry Stogov
9af4b18b81 Reverted 387c491559 (it broke ext/standard/tests/file/bug44607.phpt) 2014-06-27 00:40:52 +04:00
Xinchen Hui
387c491559 op2 is null terminated string 2014-06-26 22:13:24 +08:00
Xinchen Hui
f75c04ac8d No need to initialize it 2014-06-26 18:10:18 +08:00
Xinchen Hui
a7ce96d01f More optimizations 2014-06-26 18:09:04 +08:00
Xinchen Hui
64c5eb00b8 Let's assume the name is already lowercased 2014-06-26 17:56:55 +08:00
Xinchen Hui
284141ca8f Fixed _zend_get_parameters_array
it should not decrease the refcount (spotted by
register_shutdown_function in ext/mysqli/tests/bug49442.phpt)
2014-06-25 00:39:37 +08:00
Xinchen Hui
18bde665f5 Merge branch 'PHP-5.6' 2014-06-24 13:53:43 +08:00
Xinchen Hui
9d49492fd6 Fixed bug #67368 (Memory leak with immediately dereferenced array in class constant) 2014-06-24 13:53:05 +08:00
Dmitry Stogov
0c5a1b835e Fixed refcounting bug 2014-06-23 17:02:22 +04:00
Dmitry Stogov
bbc508dea5 Fixed string deallocation and code cleanup 2014-06-23 17:01:59 +04:00
Ferenc Kovacs
f5defa1cf2 Merge branch 'PHP-5.6'
* PHP-5.6:
  testcase for 67468 (only for debug build, as I could not create a stable segfault without loading other exts like pgsql)
  mention 67468 fix in NEWS
  Fix Bug #67468  Segfault in highlight_file()/highlight_string() when pgsql.so module is loaded
2014-06-23 10:14:08 +02:00
Ferenc Kovacs
53158f2c32 testcase for 67468 (only for debug build, as I could not create a stable segfault without loading other exts like pgsql) 2014-06-23 10:10:17 +02:00
Andreas Ferber
c5e6c2a5f5 Fix Bug #67468 Segfault in highlight_file()/highlight_string() when pgsql.so module is loaded
str_efree() must be used in zend_highlight() and zend_indent() to free
string data assigned to a zval to account for interned strings.
2014-06-23 09:51:44 +02:00
Dmitry Stogov
b108267f2c Merge branch 'master' into phpng
* master: (41 commits)
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
  Fix patch for bug #67436
  fix failed test
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
  Added tests for bug 67436
  Fixed wrong XFAIL test - already fixed
  Fix typo in Bug #67406 NEWS entry
  Fix typo in Bug #67406 NEWS entry
  ...

Conflicts:
	Zend/zend_compile.c
	ext/session/session.c
	ext/standard/array.c
	ext/standard/http_fopen_wrapper.c
	tests/classes/bug63462.phpt
2014-06-18 17:50:27 +04:00
Dmitry Stogov
a4f38192ec Use arena allocator for optimizer temporary data structures 2014-06-18 17:09:37 +04:00
Xinchen Hui
2508d493d9 Fixed typo 2014-06-18 15:11:46 +08:00
Xinchen Hui
2bd14a07fe Merge branch 'phpng' of https://git.php.net/repository/php-src into phpng 2014-06-18 12:09:51 +08:00
Xinchen Hui
6288bb8ffe Refactoring mysqlnd (incompleted, only mysqlnd ext compilable) 2014-06-18 12:09:37 +08:00
Dmitry Stogov
e1b18e59f7 Use arena allocator for zend_class_entry, zend_op_array and zend_property_info that live till the end of request 2014-06-18 02:47:01 +04:00
Dmitry Stogov
a8e63d2b56 Fixed support for constants inherited from interfaces 2014-06-17 01:15:51 +04:00
Dmitry Stogov
909acec231 Avoid useles constants update 2014-06-16 23:32:58 +04:00
Dmitry Stogov
bd10db271c Use new zend_hash iteration API 2014-06-16 21:11:52 +04:00
Dmitry Stogov
e181798405 Small call/return improvement 2014-06-16 13:25:23 +04:00
Bob Weinand
b4d61c335b Merge branch 'PHP-5.6' 2014-06-16 11:20:05 +02:00
Bob Weinand
3c2b42ac41 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_compile.c
2014-06-16 11:18:45 +02:00
Bob Weinand
e93f8e74d4 Merge branch 'PHP-5.4' into PHP-5.5 2014-06-16 11:16:33 +02:00
Bob Weinand
0a3979e08b Fix patch for bug #67436 2014-06-16 11:10:50 +02:00
Dmitry Stogov
3b2fb7abc5 Fixed support for references 2014-06-16 13:08:48 +04:00
Bob Weinand
8668f205ca Merge branch 'PHP-5.6' 2014-06-16 00:43:31 +02:00
Bob Weinand
7cef3a57ad Merge branch 'PHP-5.5' into PHP-5.6 2014-06-16 00:42:50 +02:00
Bob Weinand
03ee0ddc5f Merge branch 'PHP-5.4' into PHP-5.5 2014-06-16 00:41:46 +02:00
Levi Morrison
6c9c44905e Added tests for bug 67436 2014-06-15 16:31:39 -06:00
Bob Weinand
143cc3f0da Merge branch 'PHP-5.6' 2014-06-15 23:16:21 +02:00
Bob Weinand
f92143f740 Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	NEWS
	Zend/zend_compile.c
2014-06-15 23:06:15 +02:00
Bob Weinand
f5f1c702cd Merge branch 'PHP-5.4' into PHP-5.5 2014-06-15 22:24:44 +02:00
Bob Weinand
ca29063da5 Fix bug #67436 2014-06-15 22:18:25 +02:00
Dmitry Stogov
83817ddb1c Fixed reference counting 2014-06-12 13:01:44 +04:00
Dmitry Stogov
dd1c68e67f Merge branch 'master' into phpng
* master: (77 commits)
  NEWS entry for Fix potential segfault in dns_get_record()
  NEWS entry for "Fix potential segfault in dns_get_record()"
  NEWS entry for Fix potential segfault in dns_get_record(
  Fix potential segfault in dns_get_record()
  Revert "Add optional second arg to unserialize()"
  5.5.15 now
  update NEWS
  Fix bug #66127 (Segmentation fault with ArrayObject unset)
  5.4.31 next
  Add NEWS. This doesn't need UPGRADING (or an RFC), IMO.
  Fix broken test.
  Add a mime type map generation script and update the header.
  Move the mime type map out of php_cli_server.c for easier generation.
  Replace the CLI server's linear search for extensions with a hash table.
  fix test
  Remove unused included file
  NEWS
  NEWS
  NEWS
  Fixed Bug #67413 	fileinfo: cdf_read_property_info insufficient boundary chec
  ...

Conflicts:
	Zend/zend_closures.c
	Zend/zend_execute.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/spl/spl_array.c
	ext/standard/basic_functions.c
	ext/standard/dns.c
	ext/standard/var.c
2014-06-12 05:07:33 +04:00
Dmitry Stogov
593b125eb9 Fixed reference handling 2014-06-12 03:14:57 +04:00
Dmitry Stogov
9f6db414f8 Improved assignment code 2014-06-11 15:11:29 +04:00
Dmitry Stogov
14e6ee7f42 Use absolute addresses as branch targets for NEW, FE_RESET and FE_FETCH 2014-06-11 11:39:42 +04:00
Dmitry Stogov
592c8a0426 Improved conditions order 2014-06-11 02:46:50 +04:00
Xinchen Hui
d461afc3a2 Merge branch 'PHP-5.6' 2014-06-10 21:58:31 +08:00
Xinchen Hui
ebe6854dbc Merge branch 'PHP-5.5' into PHP-5.6
Conflicts:
	Zend/zend_execute_API.c
2014-06-10 21:58:16 +08:00
Xinchen Hui
e8699d75da Remove unused included file 2014-06-10 21:56:30 +08:00
Xinchen Hui
3c69140a90 Remove unused codes 2014-06-10 21:53:46 +08:00
Dmitry Stogov
eb9b0baaa9 Optimized for fast path 2014-06-10 01:58:28 +04:00
Dmitry Stogov
9a9bb8877e Improved ZTS support 2014-06-09 21:29:20 +04:00
Dmitry Stogov
371345bed6 Avoid reallocation 2014-06-09 17:36:37 +04:00
Dmitry Stogov
2d29f2d8d9 Comparison optimization 2014-06-09 17:00:22 +04:00
Dmitry Stogov
7bf4fa69be Avoid extra function call on hot path 2014-06-09 15:41:29 +04:00
Stanislav Malyshev
9fceb05fcf Merge branch 'PHP-5.6'
* PHP-5.6:
  Bug 64744 Show the type of the non-object for more descriptive errors
2014-06-08 19:18:09 -07:00
Boro Sitnikovski
cfccdc6362 Bug 64744
Show the type of the non-object for more descriptive errors
2014-06-08 19:14:58 -07:00
Stanislav Malyshev
a17734fb04 Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:51 -07:00
Stanislav Malyshev
8f527fbf14 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fix bug 666222
  Fix bug 666222
2014-06-08 19:02:24 -07:00
Levi Morrison
f47976dd9b Fix bug 666222
This also adds some smaller, isolated tests related to bug 66622.
2014-06-08 18:59:44 -07:00
Levi Morrison
e030efa4f6 Fix bug 666222
This also adds some smaller, isolated tests related to bug 66622.

Conflicts:
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
2014-06-08 18:59:23 -07:00
Stanislav Malyshev
19edbc9720 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Fixed identation on file
  Fix align indentation
2014-06-08 15:54:32 -07:00
Stanislav Malyshev
38343856e1 Merge branch 'PHp-5.4' into PHP-5.5
* PHp-5.4:
  Fixed identation on file
  Fix align indentation
2014-06-08 15:53:26 -07:00
Stanislav Malyshev
224f369a03 Merge remote-tracking branch 'github/pr/671'
* github/pr/671:
  Fix align indentation
  Fixed identation on file
2014-06-08 14:29:03 -07:00
Jefersson Nathan
e51eaaf665 Fix align indentation 2014-06-08 14:28:51 -07:00
Nikita Popov
2adda06544 Merge branch 'PHP-5.6' 2014-06-06 17:13:08 +02:00
Nikita Popov
6d1885342c Fix bug #67392: dtrace breaks argument unpack 2014-06-06 17:09:49 +02:00
Dmitry Stogov
e499c3d259 Introduced new BIND_GLOBAL instraction instead of FETCH_W+ASSIGN_REF pair that caused a lot of useles checks 2014-06-06 15:04:30 +04:00
Dmitry Stogov
e4581fd6b8 GC doesn't count scalars and immutable arrays in the same way 2014-06-05 21:05:07 +04:00
Dmitry Stogov
1b8916886b Speedup string equality check 2014-06-05 19:14:47 +04:00
Dmitry Stogov
730beec16e Simplify code 2014-06-05 18:42:17 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Dmitry Stogov
3d87391cc0 Reference counters in PHPNG may have different values 2014-06-04 09:57:17 +04:00
Dmitry Stogov
6e7338700e Avoid useless merge 2014-06-04 02:11:26 +04:00
Dmitry Stogov
3f6f0d5a70 Simplified and optimized ZEND_HANDLE_NUMERIC() 2014-06-03 13:10:42 +04:00
Dmitry Stogov
bc2ba841f9 Optimized conditions order 2014-06-03 09:45:09 +04:00
Dmitry Stogov
30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov
af78ea1d97 Avoid copying of immutable arrays 2014-06-03 02:43:53 +04:00
Dmitry Stogov
2bc1abe204 cleanup 2014-06-03 02:43:31 +04:00
Dmitry Stogov
0427ae08fb cleanup 2014-06-03 00:36:31 +04:00
Dmitry Stogov
032bdbba73 Improved conditions order 2014-05-30 14:40:19 +04:00
Dmitry Stogov
d2020cd91b Merge branch 'phpng' of git.php.net:php-src into phpng
* 'phpng' of git.php.net:php-src:
  typo
  Revert "Fix ArrayObject with immutable array"
  Fix ArrayObject with immutable array
2014-05-30 11:13:19 +04:00
Dmitry Stogov
984c8f87d2 Avoid useless duplication of immutable arrays 2014-05-30 11:12:24 +04:00
Xinchen Hui
9f70b2f6fa typo 2014-05-30 14:56:50 +08:00
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Nikita Popov
47e85b1b35 Improve class constant fetch fix
Dereference the cached constant for Test::TEST as well (and not just
self::TEST).

Also improve the phpt file to test this case as well - previously
this only manifested with opcache enabled, due to literal sharing.

Additionally the Z_TYPE_P != IS_REFERENCE assertion is now moved
into the TMP_VAR fetching code (as it applies to more than just
property assignments.)
2014-05-29 11:17:33 +02:00
Nikita Popov
d9a35c7e97 Fix class constant fetching
If a class is extended after the constant fetch has been cached
the cached value will be turned into a reference. On the next
fetch the polymorphic cache will return this reference, which
will be directly returned. The object assignment code then
dereferences this result and performs a shallow copy, which is
invalid for references. This subsequently leads to the constant
value being prematurely freed.

This is fixed by dereferencing the value returned from the
polymorphic cache. Furthermore the incorrect dereference from
in the object assignment code is replaced with an assertion that
we're dealing with a non-reference, so ensure that this kind of
problem cannot go unnoticed in the future.
2014-05-29 00:15:50 +02:00
Nikita Popov
411a8757ad Initialize GC_TYPE_INFO for EG(symbol_table) 2014-05-29 00:15:50 +02:00
Dmitry Stogov
d0d62d3bb0 Use new zend_hash API 2014-05-28 18:45:01 +04:00
Xinchen Hui
1966116791 retval's initializing is already taken by zend_call_function 2014-05-27 17:48:34 +08:00
Dmitry Stogov
e34a6e9211 Use new zend_hash API 2014-05-27 00:38:58 +04:00
Dmitry Stogov
05d0df4706 Use new zend_hash API 2014-05-26 21:29:35 +04:00
Nikita Popov
4ee14c6f8d Fix ** operator with references 2014-05-26 18:17:55 +02:00
Nikita Popov
ff72c7bfd7 Add test for previous commit 2014-05-26 18:13:16 +02:00
Nikita Popov
ec7b5e0b19 Fix incdec of ref object properties
This fixes a number of infinite loops in the Symfony testsuite. It
took an obscene amount of time to track this down :/
2014-05-26 18:00:15 +02:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Dmitry Stogov
22f6cf91d5 Optimize func_get_args() to build packed array 2014-05-26 17:15:52 +04:00
Xinchen Hui
b5f90e5103 Save some unnecessary zval copying 2014-05-26 17:25:57 +08:00