1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 07:28:09 +02:00
Commit Graph

62222 Commits

Author SHA1 Message Date
Dmitry Stogov 17aa81a5e2 Allocate JIT bufer close to PHP .text segment to allow using direct IP-relative calls and jumps (#8890)
This implementation is based on https://github.com/php/php-src/pull/8618 developed by Su Tao, Wang Xue, Chen Hu and Lizhen Lizhen.
2022-06-30 10:49:24 +03:00
David Carlier 7ceae66182 streams/xp_socket: fix clang build error with enum usage on bool condition.
Fix targeted for oses defining those flags as enums (like Linux/glibc).

`error: converting the enum constant to a boolean [-Werror,-Wint-in-bool-context]
                                } else if ((!sslsock->ssl_active && value == 0 && (MSG_DONTWAIT || !sslsock->s.is_blocked)) ||`

Closes #8895.
2022-06-30 05:45:33 +01:00
Michael Voříšek c756e978c4 Improve tests on 32bit
The watch_*.phpt test apparently no longer fail on 32bit, so we remove
the XFAIL conditions.  bug77269.phpt is practically identical to
bug77272.phpt, and there seems no particular reason to have an
additional test for libgd ≤ 2.2.5.

Closes GH-8448.
2022-06-29 14:04:40 +02:00
Dmitry Stogov e01586ac4f Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix incorrect condition introdused in 7cf6f17383
2022-06-29 13:09:22 +03:00
Dmitry Stogov af75eab0ef Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect condition introdused in 7cf6f17383
2022-06-29 13:09:14 +03:00
Dmitry Stogov d66d477d6f Fix incorrect condition introdused in 7cf6f17383 2022-06-29 13:08:18 +03:00
Dmitry Stogov 7e32033331 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed bug GH-8847 (PHP hanging infinitly at 100% cpu when check php syntaxe of a valid file)
2022-06-29 12:16:20 +03:00
Dmitry Stogov b7693360cb Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed bug GH-8847 (PHP hanging infinitly at 100% cpu when check php syntaxe of a valid file)
2022-06-29 12:13:03 +03:00
Dmitry Stogov 7cf6f17383 Fixed bug GH-8847 (PHP hanging infinitly at 100% cpu when check php syntaxe of a valid file) 2022-06-29 12:10:46 +03:00
George Peter Banyard 9bae9ab3a4 Fix GH-8861: correctly handle string lengths in SplFileinfo methods (#8869)
* Fix GH-8861: correctly handle string lengths in \SplFileinfo::getBasename

Co-authored-by: M. Vondano <m-vo@users.noreply.github.com>
2022-06-28 15:42:59 +01:00
Remi Collet 2223853c58 implement fseek for zip stream when possible with libzip 1.9.1 2022-06-28 15:17:27 +02:00
Chen, Hu d8de067b0f JIT: Add IBT support (#8774)
Indirect Branch Tracking (IBT) is part of Intel's Control-Flow
Enforcement Technology (CET). IBT is hardware based, forward edge
Control-Flow-Integrity mechanism where any indirect CALL/JMP must target
an ENDBR instruction or suffer #CP.

This commit adds IBT support for JIT:
1. Add endbr32/64 instruction in Dynasm.
2. Insert endbr32/64 in indirect branch target for jitted code.

gcc support CET since v8.1 and set it to default since gcc 11. With this
commit, endbr is inserted in jitted code if PHP is compiled with "gcc
-fcf-protection=full/branch".

Signed-off-by: Chen, Hu <hu1.chen@intel.com>
2022-06-28 08:42:19 +03:00
Christoph M. Becker 84c160dd90 Increase test portability
The test as is can only work if com_dotnet is built dynamically, and
not already loaded via the php.ini file.  While this is given on
AppVeyor, it may not be given in other environments.

Closes GH-8879.
2022-06-27 17:12:42 +02:00
Dmitry Stogov 7e23c838e2 Fixed Bug GH-8863: RW operation on readonly property doesn't throw with JIT 2022-06-27 16:41:53 +03:00
Dmitry Stogov ad40fffd36 Fixed Bug GH-8863: RW operation on readonly property doesn't throw with JIT 2022-06-27 14:25:30 +03:00
Ilija Tovilo 3b92a96610 Convert return type of various object handlers from int to zend_result (#8755) 2022-06-26 01:00:19 +02:00
Derick Rethans 30cc0c1742 Merge branch 'PHP-8.1' 2022-06-25 17:53:33 +01:00
Derick Rethans 49a3cc63dd Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 17:53:26 +01:00
Derick Rethans 973c3f6e24 Fixed #80047: DatePeriod doesn't warn with custom DateTimeImmutable 2022-06-25 17:52:14 +01:00
David Carlier 42c57123e9 Merge branch 'PHP-8.1' 2022-06-25 07:40:19 +01:00
David Carlier af6325f68e Merge branch 'PHP-8.0' into PHP-8.1 2022-06-25 07:39:55 +01:00
Grégoire Paris 13f55d5c1b Use proper grammar in error message
Drop period in error messages

2 reasons:
- These error messages are not regular sentences.
- Having the offending value between parenthesis after the period looks weird.
Closes GH-8858.
2022-06-25 07:39:31 +01:00
George Peter Banyard 20638dba3f Use the passed 'this' pointer instead of ZEND_THIS (#8854)
Removes the horrible hack usage of defining execute_data to be able to use ZEND_THING
2022-06-24 03:38:29 +01:00
Ilija Tovilo 50a3cb7cea Get rid of duplicated rotr3 implementation (#8853) 2022-06-23 19:09:48 +02:00
Ilija Tovilo 1453dde423 Remove zend_shared_alloc_pages declaration that was never implemented (#8852) 2022-06-23 19:08:44 +02:00
Máté Kocsis 56137cd26e Declare ext/mbstring constants in stubs (#8798) 2022-06-23 17:34:08 +02:00
Ilija Tovilo cda7e8f1ec Replace another hard-coded line number 2022-06-23 16:48:17 +02:00
Ilija Tovilo 9bfdfcac8f Replace more hard-coded line numbers 2022-06-23 16:28:42 +02:00
Ilija Tovilo 44cd74b624 Fix lineno in backtrace of multi-line function calls
Closes GH-8810
Closes GH-8818
2022-06-23 16:10:32 +02:00
George Peter Banyard 7cd8879d77 Refactor spl_filesystem_object_get_path() to return zend_string* 2022-06-23 14:41:24 +01:00
George Peter Banyard 623fbfe748 Remove Z_SPLFILESYSTEM_P macro
Remove one level of macro expansion hell
2022-06-23 14:41:24 +01:00
George Peter Banyard 4d43241e96 Move some private SPL Directory elements out of the header 2022-06-23 14:41:24 +01:00
Christoph M. Becker 365537fd6d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:28 +02:00
Christoph M. Becker bc8e52f651 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8848: imagecopyresized() error refers to the wrong argument
2022-06-23 15:22:09 +02:00
Christoph M. Becker 9405f43ba9 Fix GH-8848: imagecopyresized() error refers to the wrong argument
Closes GH-8849.
2022-06-23 15:20:49 +02:00
Ilija Tovilo 0429159775 Fully convert accel_remap_huge_pages to use zend_result
Changes were lost during rebase...
2022-06-22 18:10:05 +02:00
Ilija Tovilo 1380b65d26 Remove reundant address comparison in accel_remap_huge_pages
Closes GH-8830

MAP_FIXED guarantees mmap will return that exact address or fail so the
address comparison is redundant.

The return value of this function is unused but I kept it because it
improves readability.
2022-06-22 18:01:53 +02:00
Pierrick Charron 6b6e5f3748 Add AllowDynamicProperties on OCILob and OCICollection
Fix GH-8756 : oci_new_descriptor() triggers dynamic property
deprecation.

This fix should be temporary. At some point we should either define
those properties or just hide them since they should probably not be
used.

Better fix is here : https://github.com/php/php-src/pull/8758 but
waiting feedback from Oracle team before going ahead.
2022-06-22 06:40:41 -04:00
jcm 804c708023 Add test for iconv_strpos() internal encoding error
Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>

Closes GH-8816.
2022-06-21 14:14:55 +02:00
Christoph M. Becker 1a3d836fa1 Fix CS (missing space) 2022-06-21 13:43:13 +02:00
Christoph M. Becker a1b05a3a40 Tweak $count range check of array_fill()
We fix the `UNEXPECTED(EXPECTED(…))`, which does not make sense, and
replace the magic number with the respective macro.   We also add a
test case to verify the expected behavior for an `array_fill()` edge
case.

Closes GH-8804.
2022-06-21 11:39:05 +02:00
Christoph M. Becker 7e8ad578ab Fix bad merge (b8dee9b3fc) 2022-06-20 18:46:17 +02:00
George Peter Banyard d5d0b07b4e Early return in spl_filesystem_file_rewind() 2022-06-20 17:27:35 +01:00
George Peter Banyard a493c94471 Use bool for silent parameter in SPL directory.c 2022-06-20 17:27:25 +01:00
Christoph M. Becker b8dee9b3fc Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8827: Intentionally closing std handles no longer possible
2022-06-20 18:04:34 +02:00
Christoph M. Becker a8437d08a8 Fix GH-8827: Intentionally closing std handles no longer possible
We revert the commits which caused this regression from the PHP-8.0 and
PHP-8.1 branches for now.  We keep it in "master" because of PR #8833
which may offer a proper fix without BC break.
2022-06-20 18:01:02 +02:00
David Carlier bfe6f9e66a Introduction of timing attack safe bcmp implementation.
Nothing new but to refactor usage b/w hash and password
extensions but using volatile pointers to be a bit safer,
allowing to expand its usage eventually.
2022-06-20 16:30:30 +01:00
cmp 6bd0175173 Prevent fclose on underlying SplFileObject file stream. (#7920) 2022-06-20 13:37:59 +01:00
Yurun 5cf2659fa5 Replace the use of ZVAL_BOOL() with ZVAL_TRUE() or ZVAL_FALSE() where the value is fixed (#8815) 2022-06-20 13:34:44 +01:00
David CARLIER ec0331f499 intl ICU C++ code modernisation, making it closer to C++11 (#8650) 2022-06-20 13:07:28 +01:00