1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Commit Graph

3751 Commits

Author SHA1 Message Date
Dmitry Stogov ced8e88438 JIT/x86: Fixed possible incorrect register allocation 2021-06-17 18:42:11 +03:00
Dmitry Stogov 1082669e24 JIT: Fixed failures of tracing JIT with CALL VM
This fixes:
- tests/lang/bug28800.phpt
- Zend/tests/settype_resource.phpt
- Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
2021-06-17 14:21:40 +03:00
Dmitry Stogov df16fd149b Fixed incorrect type inference for "(array)$null". 2021-06-17 13:03:09 +03:00
Nikita Popov 67cf04f791 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Mitigation for bug #81096
2021-06-10 10:54:21 +02:00
Nikita Popov 3f4bc94b00 Mitigation for bug #81096
This issue is properly fixed by GH-7121 on master. For older
branches, disable the use of range information in SCCP, to
reduce impact of potentially incorrect ranges.
2021-06-10 10:52:53 +02:00
Dmitry Stogov ac65f6af6e Fixed bug #81051 (Broken property type handling after incrementing reference) 2021-05-27 15:22:34 +03:00
Máté Kocsis ceb0951fa5 mysqli_get_client_info() cannot return null
This method is already deprecated
2021-05-26 17:48:35 +02:00
Nikita Popov 9f6ee9f4d7 Update func info for mysqli_connect 2021-05-26 14:36:21 +02:00
Dmitry Stogov 11a7310b49 Disable ASSIGN + SEND_VAL fusion for cases when destroying of old value may throw an exception. 2021-05-21 13:36:58 +03:00
Dmitry Stogov 025c0763e7 Fix register save/restore around calls. (This fixes
ext/opcache/tests/jit/fetch_dim_rw_001.phpt with -d opcache.jit=1202
without PROFITABILITY_CHECKS)
2021-05-21 11:08:56 +03:00
Dmitry Stogov bf21261c63 Add missing undefined variable warning an result initialization.
(This fixes Zend/tests/bug78531.phpt without PROFITABILITY_CHECKS).
2021-05-21 10:03:00 +03:00
Dmitry Stogov db309b2e4b Don't assign to string offset after exception (This fixes
Zend/tests/bug31098.phpt failure without PROFITABILITY_CHECKS)
2021-05-21 00:48:24 +03:00
Dmitry Stogov cce0cc8836 JIT: Fixed incorrect condition (this leaded to
Zend/tests/type_declarations/typed_properties_083.phpt failure without
PROFITABILITY_CHECKS)
2021-05-21 00:01:00 +03:00
Dmitry Stogov 6e2d47e071 Fixed bug #80968 (JIT segfault with return from required file) 2021-05-20 16:45:24 +03:00
Nikita Popov 62a9f97381 Move preload_autoload assignment into preload_load()
We need to set the preload autoloader even if preloading happened
in a different process. accel_preload() will only run in one.

In particular, this fixes the behavior if preload_user is used.
2021-05-19 12:55:46 +02:00
Nikita Popov c446d68f7c Fixed bug #81046
Literal compaction was incorrectly assuming that literals with
the same base literal and the same number of related literals
would be equal. Maybe that was the case historically, but at
least it isn't true in PHP 8, where FETCH_CONSTANT and INIT_METHOD
have distinct literals at the second position.

Fix this by making the cache key a concatenation of all literals,
rather than just the base literal. We still distinguish the number
of related literals based on a bias added to the string hash.
2021-05-17 15:46:49 +02:00
Dmitry Stogov e96b984026 Fixed JIT on first function execution (opcache.jit=1215) with CALL VM 2021-05-12 12:24:18 +03:00
Dmitry Stogov 6fa4493f7b Fixed incorrect stack size calculation (sizeof(zval) == 16) 2021-05-12 02:08:53 +03:00
David Carlier d87d2f006c opcache: more reliable way to get the current binary on solaris/illumos
Closes GH-6920.
2021-05-06 14:33:53 +02:00
Nikita Popov dd3e56ba24 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81015
2021-05-06 10:46:30 +02:00
Nikita Popov 178bbe3478 Fixed bug #81015
Make sure that the previous opline is part of the same block,
otherwise it may be non-dominating.

The test case does not fail on PHP-7.4, but I think the general
problem can appear on 7.4 as well, so I'm applying the patch to
that branch.
2021-05-06 10:46:00 +02:00
Nikita Popov bf9dc53435 Fixed bug #81007
Backport a change from the master branch. We usually test 32-bit
using -m32 from an x86-64 host, probably nobody tried using an
actual 32-bit host.
2021-05-05 16:53:43 +02:00
Nikita Popov 2ceef24f4a Remove incorrect func info for array_reduce() and pos()
These are both clearly not rc1 functions. As they are otherwise
UNKNOWN_INFO, I'm just dropping them entirely.
2021-04-28 11:41:21 +02:00
Nikita Popov 028dd891f9 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  filter_var_array() may return array_of_ref
2021-04-28 11:27:55 +02:00
Nikita Popov 5acab7ebb4 filter_var_array() may return array_of_ref
This function preserves references in the input array.
2021-04-28 11:27:14 +02:00
Nikita Popov 220ffb90d0 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  fetch_assoc may return array_key_long
2021-04-28 11:20:38 +02:00
Nikita Popov 67c4d1f5b9 fetch_assoc may return array_key_long
If the column name is a number (which is possible at least via
AS clauses), then symtable canonicalization will convert it into
an integer key.
2021-04-28 11:18:36 +02:00
Nikita Popov 76d1120a48 Remove assert_options() return value info
The ASSERT_CALLBACK value is not validated at all -- it's possible
to set it to an arbitrary value. As such, the function can also
return any value or type (even without outright abuse, the opcache
func info was wrong in that the return can be rcn, and the array
can be array_of_ref).
2021-04-28 11:05:05 +02:00
Nikita Popov af9fadc55a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  password_get_info() may return array_of_null
2021-04-28 10:55:43 +02:00
Nikita Popov c340f97ab0 password_get_info() may return array_of_null
The algo key is set to null if the algorithm can't be detected.
2021-04-28 10:54:31 +02:00
Nikita Popov 4a5bda6a8d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  getdate() may return array_key_long
2021-04-28 10:47:45 +02:00
Nikita Popov c7387ab92f getdate() may return array_key_long
This function mostly uses string keys, but the timestamp is
returned at key 0 (why???)
2021-04-28 10:46:37 +02:00
Nikita Popov 98a071e880 pg_connect() may return rcn
Without CONNECT_FORCE_NEW, pg_connect() may resuse an existing
connection and refcount may be larger than one.
2021-04-28 10:36:48 +02:00
twosee d4a206b276 Backport "ignore some opcodes in the JIT check"
This is a backport of fc64a7bef4 to the PHP-8.0 branch so that extensions don’t have to bypass the JIT check in a hacky way.
2021-04-19 14:28:15 +08:00
twosee a3e6735999 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #80900

# Conflicts:
#	ext/opcache/Optimizer/sccp.c
2021-04-14 00:15:06 +08:00
twosee 7c6cf09463 Fixed bug #80900
SCCP optimization marks the wrong target feasible when the constant is of the incorrect type.

Closes GH-6861.
2021-04-14 00:07:32 +08:00
Nikita Popov a1fdfa700b Fixed bug #80950
Function info for curl_exec() incorrect specified that the
function cannot return true. This is already fixed in PHP 8,
as the func info entry was removed there.
2021-04-12 16:05:37 +02: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 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 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
Dmitry Stogov 7e494d9225 Fixed bug #80861 (erronous array key overflow in 2D array with JIT) 2021-03-17 22:59:59 +03:00
Dmitry Stogov faf1567212 Fixed bug #80839 (PHP problem with JIT) 2021-03-17 16:55:09 +03:00
Nikita Popov 82622d7583 Fix refcount inference for typed properties
We were not adding RC1/RCN if the MAY_BE_OBJECT came from a class
type and there was no other refcounted type in the union.
2021-03-16 11:17:18 +01:00
Michael Heimpold eaf9421df6 ext/opcache: fix configure output while checking mmap MAP_ANON support
It seems that f3efb9e3fb introduced a "typo" which may result
in the following confusing message:

checking for mmap() using MAP_ANON shared memory support... no=yes

Let's fix this.

Signed-off-by: Michael Heimpold <mhei@heimpold.de>

Closes GH-6758.
2021-03-15 10:52:57 +01:00
Dmitry Stogov 3b377b51a2 Fixed bug #80814 (threaded mod_php won't load on FreeBSD: No space available for static Thread Local Storage) 2021-03-10 16:03:47 +03:00
David Carlier ae23852e41 Add supports for FreeBSD's PROT_MAX to let mprotect knows X flag can be applied in addition.
Closes GH-6738.
2021-03-05 16:44:08 +01:00
Christoph M. Becker 1c16749eaa Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Print error code if CreateMutex() fails
2021-03-05 15:08:24 +01:00