1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 19:41:05 +02:00
Commit Graph

123479 Commits

Author SHA1 Message Date
Dmitry Stogov
12ed58eca0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed type inference for OP_DATA
2021-04-09 14:53:44 +03:00
Dmitry Stogov
61e385a358 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed type inference for OP_DATA
2021-04-09 14:53:34 +03:00
Dmitry Stogov
7a8ffcec7d Fixed type inference for OP_DATA 2021-04-09 14:52:55 +03:00
Nikita Popov
46a884bb67 Don't leak include_path if it cannot be interned 2021-04-09 13:05:27 +02:00
Nikita Popov
24969b7cd0 Fix incorrect --CREDITS-- section 2021-04-09 12:40:04 +02:00
Nikita Popov
fe9f4298b5 Fix class map ptr for parent type if interning disabled
As zend_update_parent_ce() only runs later, the parent reference
may still point to the original class entry rather than the
persisted one. Memory held by the original class entry may have
already been deallocated. Avoid use-after-free by explicitly
fetching the persisted parent CE.
2021-04-09 12:24:12 +02:00
Dmitry Stogov
000564a599 Use Fast Class Cache 2021-04-09 12:48:54 +03:00
Dmitry Stogov
f681c4a775 Use Fast Class Cache to speedup object unserialization 2021-04-09 11:36:13 +03:00
George Peter Banyard
09efad615b Use zend_string_equals_(literal_)ci() API more often
Also drive-by usage of zend_ini_parse_bool()

Closes GH-6844
2021-04-09 02:34:50 +01:00
Dmitry Stogov
f191e4f257 Avoid destructor call for LONG keys 2021-04-09 00:49:27 +03:00
Dmitry Stogov
556d752667 Prevent call of var_push_dtor_value() on hot path.
When serialising object properties, they are oftet may override the
default values, however default values are most often scalars, interned
strings or immutable arrays.
2021-04-09 00:40:17 +03:00
Dmitry Stogov
d8e4fbae62 Fast Class Cache
This is generalization of idea, that was previously usesd for caching
resolution of class_entries in zend_type. Now very similar mechanizm is
used for general zend_string into zend_class_entry resolution.

Interned zend_string with IS_STR_CLASS_NAME_MAP_PTR GC_FLAG uses its
refcount to adress corresponding zend_class_entry cache slot.
The refcount keeps an offset to this slot from CG(map_ptr_base).
Flag may be checked by ZSTR_HAS_CE_CACHE(str), cache slot may be read by
ZSTR_GET_CE_CACHE(str) and set by ZSTR_SET_CE_CACHE(str, ce).
2021-04-08 23:37:40 +03:00
Nikita Popov
ad4b928750 Drop unused fgetss_state member 2021-04-08 22:27:00 +02:00
Nikita Popov
47a722e77f Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't mark non-refcounted phi as live
2021-04-08 18:24:57 +02:00
Nikita Popov
332a367538 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Don't mark non-refcounted phi as live
2021-04-08 18:21:00 +02:00
Nikita Popov
29fa4d203a Don't mark non-refcounted phi as live
If the value is not refcounted, then it doesn't matter if the
FREE gets dropped.
2021-04-08 18:20:09 +02:00
Nikita Popov
dbe2cdd7dc Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix DCE of FREE of COALESCE

Note that this is a non-trivial merge, as opt/coalesce.phpt
regresses with this change. I'll have to see if it can be
improved.
2021-04-08 17:06:40 +02:00
Nikita Popov
59b2a899ca Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix DCE of FREE of COALESCE
2021-04-08 17:01:19 +02:00
Nikita Popov
0826a54836 Fix DCE of FREE of COALESCE
When encountering the following SSA graph:

    BB1:
    #2.T1 [string] = COALESCE #1.CV0($str) [null, string] BB2

    BB2:
    #5.T1 [string] = QM_ASSIGN string("")

    BB3:
    #7.X1 [string] = Phi(#2.X1 [string], #5.X1 [string])
    FREE #7.T1 [string]

We would currently determine that #7, #5 are dead, and eliminate
the FREE and QM_ASSIGN. However, we cannot eliminate #2, as
COALESCE is also responsible for control flow.

Fix this my marking all non-CV phis as live to start with. This
can be relaxed to check the kind of the source instruction, but
I couldn't immediately come up with a case where it would be
useful.
2021-04-08 17:01:13 +02:00
Remi Collet
513ad9791d Merge branch 'PHP-8.0'
* PHP-8.0:
  Improve fix for #80783
2021-04-08 15:28:48 +02:00
Remi Collet
f421ebc056 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Improve fix for #80783
2021-04-08 15:28:29 +02:00
Remi Collet
25f5a1b2e1 Improve fix for #80783 2021-04-08 15:28:03 +02:00
Nikita Popov
7f4513f1cb Merge branch 'PHP-8.0'
* PHP-8.0:
  Support more than NGROUPS_MAX groups on macos
2021-04-08 12:25:26 +02:00
Nikita Popov
032905b5a0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Support more than NGROUPS_MAX groups on macos
2021-04-08 12:25:16 +02:00
Nikita Popov
eebcfeb68e Support more than NGROUPS_MAX groups on macos
I suspect this is the cause for our recent CI failures. Apparently,
on macos it is possible for getgroups() to return more than
NGROUPS_MAX groups. We avoid an EINVAL in that case by fetching
the exact number of groups in advance. This should work on both
macos and posix systems.
2021-04-08 12:23:39 +02:00
Nikita Popov
3e2e2f12cb Display error message when posix_getgroups() test fails
This test started having many intermittent failures on MacOS
recently.
2021-04-08 10:45:43 +02:00
Max Semenik
7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00
Dmitry Stogov
4034d83432 unserialize() optimization 2021-04-07 18:36:14 +03:00
Dmitry Stogov
b3e59dc16f unserialize() optimization 2021-04-07 15:24:53 +03:00
Christoph M. Becker
0496d225a2 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update version in main/php_version.h as well
2021-04-07 12:54:26 +02:00
Christoph M. Becker
ba6714a200 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update version in main/php_version.h as well
2021-04-07 12:52:44 +02:00
Christoph M. Becker
0a181ca27a Update version in main/php_version.h as well
Otherwise the file is modified by each new build, what is confusing.
2021-04-07 12:45:21 +02:00
George Peter Banyard
5caaf40b43 Introduce pseudo-keyword ZEND_FALLTHROUGH
And use it instead of comments
2021-04-07 00:46:29 +01:00
George Peter Banyard
8a86fe11da Add missing break; in Zlib extension 2021-04-07 00:46:17 +01:00
Derick Rethans
4e3d469c4a Skip test on 32bit, as the timestamp range is outside 32bit range 2021-04-06 23:54:51 +01:00
Anatol Belski
7251f3900e fileinfo: Update the patch
Signed-off-by: Anatol Belski <ab@php.net>
2021-04-06 22:43:05 +02:00
Derick Rethans
a6702348cd Merge branch 'timelib-and-date-time-fixes' 2021-04-06 20:50:58 +01:00
Derick Rethans
091c0920b9 Upgrade timelib to 2021.03 and fix many date/time issues 2021-04-06 20:50:32 +01:00
Dmitry Stogov
ffb1dd0839 Use zend_hash_append*() in zend_fetch_debug_backtrace() 2021-04-06 18:25:50 +03:00
Dmitry Stogov
a13a1be734 Use ZEND_HASH_FILL_* API for explode() 2021-04-06 16:57:02 +03:00
Dmitry Stogov
e86bea8d45 Extend ZEND_HASH_FILL_* API with ZEND_HASH_FILL_GROW and use it to optimize get_declared_classes() 2021-04-06 16:18:47 +03:00
Nikita Popov
e10a7107a5 Make tokenizer_data_gen.php compatible with older PHP
Our PHP requirement is currently PHP 7.1, so don't use flexible
heredoc.
2021-04-06 15:13:21 +02:00
Christoph M. Becker
67e545f1bb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80880: SSL_read on shutdown, ftp/proc_open
2021-04-06 14:08:54 +02:00
Christoph M. Becker
de9734a5bb Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80880: SSL_read on shutdown, ftp/proc_open
2021-04-06 14:07:25 +02:00
Christoph M. Becker
9688071679 Fix #80880: SSL_read on shutdown, ftp/proc_open
When `SSL_read()` after `SSL_shutdown()` fails with `SSL_ERROR_SYSCALL`,
we should not warn about this, because it is likely caused by the peer
having closed the connection without having sent a close_notify
shutdown alert.

Signed-off-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-6803.
2021-04-06 14:03:19 +02:00
Anatol Belski
ecfb888354 fileinfo: Turn back the WS check mitigation
Looks like there's still a timing issue shown on some pipeline runs.

Signed-off-by: Anatol Belski <ab@php.net>
2021-04-06 12:29:04 +02:00
Nikita Popov
57eb29f1d3 Update zend_vm_gen.php with zend_vm_opcode.c/h changes
The generated files were modified directly, resulting in mysterious
build failures depending on exact build order.
2021-04-06 11:35:05 +02:00
Nikita Popov
7a306c0813 Fix skipif section in test
This was migrated to --EXTENSIONS--.
2021-04-06 09:58:49 +02:00
twosee
fc64a7bef4 Ignore some opcodes in JIT check
Some user opcode handler actually gets called when JIT is used, so do not disable JIT even if these user opcode handlers were registered, just ignore them.

ZEND_EXIT can help Swoole to detect exit/die operation and exit from the current coroutine and record exit_status correctly.
ZEND_*_SILENCE can help Swoole to switch EG(error_reporting) to keep the right behavior when using the error control operator.
So we ignore ZEND_EXIT, ZEND_BEGIN_SILENCE, ZEND_END_SILENCE in JIT check here.

Closes GH-6640.
2021-04-06 11:58:20 +08:00
twosee
cb8f39f247 Add zend_get_opcode_id() to get opcode id from name 2021-04-06 11:44:10 +08:00