1
0
mirror of https://github.com/php/php-src.git synced 2026-04-25 08:58:28 +02:00
Commit Graph

60228 Commits

Author SHA1 Message Date
Dmitry Stogov 97da90e85e Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed missed zval type initialization
2021-09-27 20:15:51 +03:00
Dmitry Stogov 9ce388b41b JIT: Fixed missed zval type initialization 2021-09-27 20:05:50 +03:00
Dmitry Stogov 7981d48aca JIT: Fixed missing type load 2021-09-27 17:44:36 +03:00
Nikita Popov 7d483418e2 Fix relative offsets when copying JMPZNZ
This was doing a plain copy of JMPZNZ, even though it encodes
offsets relative to the opline. As such, the offsets would be
relative to target, while they should be relative to opline.
Fix this by recomputing them.

Fixes oss-fuzz #39295.
2021-09-27 16:18:40 +02:00
Dmitry Stogov 35ff71f048 JIT: Improve property access (Avoid unnecessary property address loading and exception check). 2021-09-27 15:59:52 +03:00
Dmitry Stogov dbdef5980f JIT: Wrong register 2021-09-27 13:00:40 +03:00
Nikita Popov 823888c472 Start block at loop var free
This ensures that code directly before the loop var free is
separated out (and will generally be eliminated as unreachable).
This fixes some assumptions we have that unreachable loop var free
blocks start with the loop var free.

Fixes oss-fuzz #39395.
2021-09-27 11:56:37 +02:00
Dmitry Stogov 3e706536d9 JIT: Remove FETCH_THIS+FETCH_OBJ_* optimizations for closures for
functon JIT introduced in d1a0b93c64.

They caused failure of Zend/tests/closure_038.phpt with -d opcache.jit=1215
2021-09-27 12:52:34 +03:00
Nikita Popov ddf8910237 Fix DCE of unreachable phi in cycle
We can't remove a trivial phi of the form x = phi(x), because we
don't have a replacement value. We could drop the whole block
though. SCCP would normally do this, but in this particular case
we only determine non-reachability based on type information.

Fixes oss-fuzz #39316.
2021-09-27 11:26:31 +02:00
Nikita Popov 038bc27787 Handle pi nodes in replace_predecessor
If we're removing a predecessor because it already exists during
replacement, we should also drop pi nodes for that predecessor.

Fixes oss-fuzz #39276.
2021-09-27 10:47:47 +02:00
Dmitry Stogov bec1d2f290 JIT: Avoid property type reloading 2021-09-24 19:57:20 +03:00
Dmitry Stogov ec0f2c6ea1 JIT: Eliminate useless exception check 2021-09-24 16:52:06 +03:00
Dmitry Stogov d1a0b93c64 JIT: Improve $this->property access in closures 2021-09-24 15:55:29 +03:00
Nikita Popov eac65680ab Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix leak when iterating uninitialized RecursiveIteratorIterator
2021-09-24 13:18:00 +02:00
Nikita Popov 3adbafeef7 Fix leak when iterating uninitialized RecursiveIteratorIterator 2021-09-24 13:17:34 +02:00
Nikita Popov 2b0288b220 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix bug #81472: Support large device major/minor number
2021-09-24 09:58:22 +02:00
Lin Yang 9ad8fadcbb Fix bug #81472: Support large device major/minor number
Latest linux kernel use large number (12 bits for major device, 20
bits for minor device). Current code only supports previous standard
(5 chars), which means 8 bits for major and 8 bits for minor device.
It will fail if device number is out of that range. So this patch
increases device number read from /proc/self/maps file.

Closes GH-7512.
2021-09-24 09:57:32 +02:00
Nikita Popov 2323dc2ac7 Avoid shell for proc_terminate() test
Otherwise we're sending the signal to the shell, not the sleep
process, and it will continue sleeping.

This also illustrates a minor issue without our array proc_open()
support: We don't preserve the passed arguments in the
proc_get_status() output.
2021-09-24 09:45:49 +02:00
Tim Starling c96be7b8f2 Use ASCII lower case for misc case folding
Use ASCII case conversion instead of locale-dependent case conversion in
the following places:

* grapheme_stripos() and grapheme_strripos() in the "fast" path
* ldap_get_entries()
* oci_pconnect() for case folding of parameters when constructing a key
  into the connection or session pool
* SoapClient: case folding of function names
* get_meta_tags(): case conversion of property names
* http stream wrapper: header names
* phpinfo(): anchor names
* php_verror(): docref URLs
* rfc1867.c: Content-Type boundary parameter name
* streams.c: stream protocol names

Using locale-dependent case folding for these cases is either
unnecessary or actively incorrect. These functions could have
misbehaved when used with certain locales (e.g. Turkish).

Closes GH-7511.
2021-09-24 09:20:08 +02:00
Dmitry Stogov 92d0abd075 Fixed typo 2021-09-24 09:20:57 +03:00
Christoph M. Becker 67131e453b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix gdAlphaMax limit typo
2021-09-23 23:20:00 +02:00
Christoph M. Becker c0dcd141a8 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix gdAlphaMax limit typo
2021-09-23 23:18:52 +02:00
Michael Voříšek 2c3dfe5160 Fix gdAlphaMax limit typo
Closes GH-7410.
2021-09-23 23:16:40 +02:00
Dmitry Stogov c7c7620918 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed possible incorrect megamorphic call from a trait
2021-09-23 23:41:11 +03:00
Dmitry Stogov 3e6919cfb3 Tracing JIT: Fixed possible incorrect megamorphic call from a trait 2021-09-23 23:38:03 +03:00
Nikita Popov 46315defc7 Use locale-independent case conversion in mb_send_mail()
Headers should not be processed in a locale-depdendent fashion.
Switch from upper to lowercasing because that's the standard for
PHP and we provide an ASCII implementation of this operation.

This is adapted from GH-7506.
2021-09-23 17:20:54 +02:00
Dmitry Stogov a0bea10e5b JIT: Fixed register clobbering 2021-09-23 15:04:05 +03:00
Dmitry Stogov 5eb3e30867 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Remove incorrect assertion
2021-09-23 12:15:05 +03:00
Dmitry Stogov 430454268f Tracing JIT: Remove incorrect assertion 2021-09-23 12:14:33 +03:00
Dmitry Stogov 757c1277eb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed possible stack-buffer-overflow.
2021-09-23 10:52:17 +03:00
Dmitry Stogov 08100e81e5 Tracing JIT: Fixed possible stack-buffer-overflow. 2021-09-23 10:51:20 +03:00
Dmitry Stogov 0f084387f8 Fixed use-after-free introduced in f2ceb639b8 2021-09-23 10:37:25 +03:00
Dmitry Stogov 4317da35d3 Remove weird condition 2021-09-23 01:12:49 +03:00
Dmitry Stogov 114a0ffd19 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Check for zend_shared_alloc() failures
2021-09-23 01:01:26 +03:00
Dmitry Stogov 17a99f2b11 Check for zend_shared_alloc() failures 2021-09-23 01:00:50 +03:00
Máté Kocsis 8168d312f9 Fix a few more classsynopsis generation issues
Closes GH-7480
2021-09-22 23:09:43 +02:00
Dmitry Stogov b9f12d628f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed possible memory leak
2021-09-22 22:58:57 +03:00
Dmitry Stogov 09d4037a17 JIT: Fixed possible memory leak 2021-09-22 22:57:57 +03:00
Nikita Popov 2dc8c7b3a7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix ASSIGN_STATIC_PROP_REF type inference
2021-09-22 15:55:42 +02:00
Nikita Popov 983a4fc4a3 Fix ASSIGN_STATIC_PROP_REF type inference
We were not inferring anything for the ASSIGN_STATIC_PROP_REF
result type at all, leaving it as an empty type. In the test
case this results in a live range being incorrectly eliminated,
but this could break in all kinds of other ways as well..
2021-09-22 15:55:25 +02:00
Dmitry Stogov c77c79a093 JIT: Fixed memory leak when opperand of ADD IS_VAR and IS_REFERENCE 2021-09-22 16:37:48 +03:00
Nikita Popov 560dafb50f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix JIT typed property inc/dec
2021-09-22 15:32:59 +02:00
Nikita Popov 770879702a Fix JIT typed property inc/dec
This was leaking memory for pre-inc/dec of a refcounted typed
property if the result was not used.

The code to do this was unnecessarily complicated, we can base
this on the zend_jit_inc/dec_typed_prop() helper and copy to the
result afterwards.
2021-09-22 15:32:19 +02:00
Nikita Popov 4fcca032e1 Make IntlCalendar::roll() return type tentative
This method did not have a type in PHP 8.0 and is not final, so
the new return type should be tentative.
2021-09-22 15:00:29 +02:00
Dmitry Stogov cffba945e5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed type inference
2021-09-22 15:32:16 +03:00
Dmitry Stogov e588f24276 Fixed type inference 2021-09-22 15:30:30 +03:00
Dmitry Stogov 5860a390d5 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed JIT for FETCH_OBJ when op1 is a reference of non-object
2021-09-22 14:55:02 +03:00
Dmitry Stogov 7a93a8a6fd JIT: Fixed JIT for FETCH_OBJ when op1 is a reference of non-object 2021-09-22 14:52:25 +03:00
Dmitry Stogov f2ceb639b8 Tracing JIT: Record information about types of defined object properties and use it to optimize code for ASSIGN_OBJ_OP, PRE/POST_INC/DEC_OBJ and FETCH_OBJ_R/IS 2021-09-22 14:08:31 +03:00
Dmitry Stogov 4d4a175dc0 Tracing JIT: Fixed FETCH_DIM_R with packed array and negative key 2021-09-22 02:05:05 +03:00