1
0
mirror of https://github.com/php/php-src.git synced 2026-04-02 21:52:36 +02:00
Commit Graph

118839 Commits

Author SHA1 Message Date
Máté Kocsis
0de3ca4f98 Let's try to fix the JIT compiler warning 2020-05-26 20:56:29 +02:00
Máté Kocsis
fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Christoph M. Becker
38c85efe83 Fix picky builds
Due to `-Werror=maybe-uninitialized` a bogus warning may be thrown, so
we initialize the variable to work-around that.
2020-05-26 18:37:29 +02:00
Christoph M. Becker
d2508ef947 Merge branch 'PHP-7.4'
* PHP-7.4:
  Enable phpdbg tests on AppVeyor
  Make phpdbg test portable
  Fix several mostly Windows related phpdbg bugs
  Fix #73926: phpdbg will not accept input on restart execution
2020-05-26 17:46:56 +02:00
Christoph M. Becker
9fad9addb5 Enable phpdbg tests on AppVeyor 2020-05-26 17:45:35 +02:00
Christoph M. Becker
9d5dafe040 Make phpdbg test portable 2020-05-26 17:45:35 +02:00
Christoph M. Becker
8483a21f29 Fix several mostly Windows related phpdbg bugs
* Properly initialize PHPDBG_G(watch_tmp)

  Otherwise that may cause segfaults in ZTS builds.

* Deactivate potentially remaining watchpoints after REPL

  Otherwise the memory could still be protected, resulting in segfaults
  during shutdown.

* NULL zend_handlers_table after freeing

  As of commit 4130fe4[1], the `zend_handlers_table` is explicitly
  freed in the `zend_vm_dtor()`.  Since phpdbg (and maybe some other
  SAPIs) may restart the engine afterwards, we have to make sure that
  the table is also NULLed.

* Only set context option if there is a context

  In other words, we must not follow the null pointer.

* Cater to file handles without attached console

  File handles do not necessarily have an attached console (for
  instance, pipes do not), in which case `GetConsoleScreenBufferInfo()`
  fails.  In this case we set a default value (`40`) for lines like on
  other systems.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=4130fe437a5db7ead1444d3748bd0fbad9829cb2>
2020-05-26 17:45:25 +02:00
Christoph M. Becker
e483761a1e Fix #73926: phpdbg will not accept input on restart execution
We are more liberal, and accept Windows line endings (CRLF) as well.
2020-05-26 17:44:39 +02:00
Christoph M. Becker
31e410e098 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79595: zend_init_fpu() alters FPU precision
2020-05-26 17:21:29 +02:00
Christoph M. Becker
879004dae3 Fix #79595: zend_init_fpu() alters FPU precision
On startup, PHP deliberately changes the floating point control word to
enforce binary64 format for the calculations for best consistency
across platforms.  However, this is unnessary for x86_64 architectures,
because in this case SSE instructions are used by default, and there is
no good reason to pass `-mfpmath=i387` or such.

Therefore, we can skip the modification, which has the benefit that
system libraries are free to work in the mode of their liking.
2020-05-26 17:19:54 +02:00
Dmitry Stogov
15aa891c5e Fixed JIT for integer overflow checks 2020-05-26 17:59:15 +03:00
Nikita Popov
baa285881f Fix variable type
This is no longer a boolean.
2020-05-26 15:58:36 +02:00
Tyson Andre
9b33272536 Allow generators to have a real return type of mixed or object
Fixes an edge case overlooked in
https://github.com/php/php-src/pull/5313

Generators are objects, so `object` should have also been allowed in addition to
`iterable` and `Traversable`

Closes GH-5626
2020-05-26 09:57:10 -04:00
Derick Rethans
446525cb87 Merge branch 'PHP-7.4' 2020-05-26 14:20:24 +01:00
Derick Rethans
c6fc400e8b Add (expected) release date, and new header for 7.4.8 2020-05-26 14:20:06 +01:00
Derick Rethans
46d88a49cc This bug fix was cherry picked into 7.4.6 2020-05-26 14:19:13 +01:00
Max Semenik
23ee4d4b57 Support catching exceptions without capturing them to variables
RFC: https://wiki.php.net/rfc/non-capturing_catches

Closes GH-5345.
2020-05-26 15:12:18 +02:00
Nikita Popov
1203bbf07e Merge branch 'PHP-7.4'
* PHP-7.4:
  Respect typed references in catch assignment
2020-05-26 15:03:26 +02:00
Nikita Popov
4a08ca1294 Respect typed references in catch assignment
I decided to null out EG(exception) early here, which means only
the exception from the dtor / ref assign is preserved, and the
previous exception is not chained in. This is more robust, and
I don't think this situation is common enough to be bothered about
the precise behavior.
2020-05-26 14:59:40 +02:00
Nikita Popov
2daa89b1e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix zend_assign_to_typed_ref() implementation
2020-05-26 14:44:09 +02:00
Nikita Popov
314ab47e55 Fix zend_assign_to_typed_ref() implementation
There was some confusion going on here regarding the original
value vs the copied value.

I've dropped the needs_copy variable, because this code is not
inlined, so it would always be true anyway.

What we need to do is perform a move-assignment of the copied
value (in which case we don't care about performing the assignment
before destroying garbage), and destroying the original value
for the VAR/TMP cases. This is a bit complicated by the fact that
references are passed in via a separate ref variable, so we can't
just ptr_dtor the original variable.
2020-05-26 14:42:27 +02:00
Dmitry Stogov
59e69eb1c9 Fixed JIT for (LONG_MIN % -1) 2020-05-26 14:49:29 +03:00
Derick Rethans
ac2dd9d5e8 Merge branch 'PHP-7.4' 2020-05-26 11:47:43 +01:00
Derick Rethans
fb370ecbe5 Fixed historical dates in NEWS 2020-05-26 11:47:26 +01:00
Nikita Popov
81c824f41f Clarify ZEND_CATCH code
UNDEF the opcode result instead of addref'ing the exception.
2020-05-26 11:34:07 +02:00
Max Semenik
f825c0bb88 Improve language in error messages
Closes GH-5617
2020-05-26 11:27:07 +02:00
Christoph M. Becker
2261234720 Merge branch 'PHP-7.4'
* PHP-7.4:
  7.3.20 will be next
2020-05-26 10:58:45 +02:00
Christoph M. Becker
ee36478a03 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.20 will be next
2020-05-26 10:56:28 +02:00
Christoph M. Becker
c249f593ef 7.3.20 will be next 2020-05-26 10:53:22 +02:00
Dmitry Stogov
cf3b133a86 Fixed JIT for SEND_VAR $undefined_cv 2020-05-26 10:13:57 +03:00
Nikita Popov
ca358001b9 Revert "Fixed JIT for SEND_VAR $undefined_cv"
This reverts commit d60988257b.

This change causes segfaults in many tests.
2020-05-25 23:51:11 +02:00
Dmitry Stogov
0386cbb95c Fixed tracing JIT for RETRUN $undefined_cv 2020-05-25 22:19:13 +03:00
David Carlier
e8ba8908a9 proc_open FreeBSD build fix
On this platform the needed header is different.

Closes GH-5623
2020-05-25 18:38:38 +02:00
Máté Kocsis
b3718430de Annotate internal functions with the mixed type
Closes GH-5618
2020-05-25 17:30:57 +02:00
Máté Kocsis
cbf86efc21 Fix ZPP of v*printf() 2020-05-25 17:29:46 +02:00
Máté Kocsis
43095a55e2 Promote warning related to operator overloading in ext/gmp to an exception 2020-05-25 17:26:33 +02:00
Dmitry Stogov
d60988257b Fixed JIT for SEND_VAR $undefined_cv 2020-05-25 18:24:50 +03:00
Dmitry Stogov
4aa8678306 ZEND_ACC_IMMUTABLE may be reset for closures 2020-05-25 17:45:13 +03:00
Dmitry Stogov
bfc56ed511 Keep trace number in EG(jit_trace_num) instead of EG(reserved)[zend_func_info_rid] 2020-05-25 17:05:26 +03:00
Dmitry Stogov
3376f19742 Check for ZEND_HANDLE_EXCEPTION opcode before accessing opline trace info. 2020-05-25 16:45:45 +03:00
Dmitry Stogov
201491e61b Replace warning code by side exit to VM 2020-05-25 15:14:27 +03:00
Dmitry Stogov
b35a9a4ce6 Reorder conditions to save one instruction in recursive return loop 2020-05-25 12:55:03 +03:00
Christoph M. Becker
ce668c0ec6 PGSQL and POD_SQL: don't include pg_config.h
Even if that header file is available, we better consider it private,
and don't include it.  The information about whether SSL support is
enabled is now missing (`USE_(OPEN)SSL`), and it seems there is no
alternative way to get it (`PQinitSSL()` is always defined), so we
remove it from the PHP info.  Furthermore, the `PG_VERSION` and
`PG_VERSION_STR` macros are no longer available, but as of libpq 9.1
there is `PQlibVersion()` which allows us to construct `PG_VERSION` in
a most likely backwards compatible manner.  The additional information
available through `PG_VERSION_STR` is lost, though, so we define
`PGSQL_LIBPQ_VERSION_STR` basically as alias of `PGSQL_LIBPQ_VERSION`,
and deprecate it right away.

Since we are now requiring at least libpq 9.1, we can remove some
further compatibility code and additional checks.

Regarding the raised requirements: official support for PostGreSQL 9.0
ended on 2015-10-08, and even CentOS 7 already has PostGreSQL 9.2, so
this is not supposed to be too much of an issue.
2020-05-25 10:48:35 +02:00
Tyson Andre
f3efb9e3fb Fail in ./configure when no opcache shm backends exist
This can be seen when the `./configure` step fails to detect `HAVE_SHM_*`,
e.g. due to missing a necessary dependency to compile the test scripts.
(Run `./configure`, run `yum install libtool-ltdl-devel` for missing dependencies,
then run `make`, and php can end up built with 0 shared memory opcache caches)

Give a clearer error message than `unknown`
Searching for `opcache "Fatal Error Unable to allocate shared memory segment of"
"unknown: No such file or directory"` reveals issues such as
https://github.com/termux/termux-packages/issues/2234

Closes GH-5615
2020-05-24 17:49:52 -04:00
George Peter Banyard
cebe750f46 Refactor ZPP API to use uint32_t as everywhere else
Closes GH-5609
2020-05-22 17:13:42 +02:00
George Peter Banyard
bc3ee2eeea [skip-ci] Update UPGRADING
Add upgrading note for mixed type and removal of curly braces offset syntax
2020-05-22 17:02:30 +02:00
Nikita Popov
b9d0ff7634 Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Fix #79595: zend_init_fpu() alters FPU precision"
2020-05-22 16:57:24 +02:00
Nikita Popov
10eb842a64 Revert "Fix #79595: zend_init_fpu() alters FPU precision"
This reverts commit 88dfc475c5.
2020-05-22 16:57:14 +02:00
George Peter Banyard
c803499e23 Remove depreacted curly brace offset syntax
Closes GH-5221
2020-05-22 16:52:17 +02:00
Nikita Popov
a307e48d67 Merge branch 'PHP-7.4'
* PHP-7.4:
  Show diffs for failed tests on Azure CI
2020-05-22 16:37:22 +02:00