124445 Commits
Author SHA1 Message Date
Nikita Popov 7a766401eb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix bug #81068: Fix possible use-after-free in realpath_cache_clean()
2021-05-25 11:41:06 +02:00
Nikita Popov 0fb371440d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81068: Fix possible use-after-free in realpath_cache_clean()
2021-05-25 11:40:57 +02:00
Dimitry Andric 99a208566a Fix bug #81068: Fix possible use-after-free in realpath_cache_clean()
If ZTS is enabled, this can cause cwd_globals_ctor() to be called
multiple times, each with a freshly allocated virtual_cwd_globals
instance. At shutdown time however, cwd_globals_dtor() will call
realpath_cache_clean(), which then possibly cleans up the same
realpath_cache instance more than once. Using AddressSanitzer, this
shows up as a heap use-after-free.

To avoid this, add a helper function to do the actual work on one
instance of a realpath_cache, and call it both from cwd_globals_dtor()
and realpath_cache_clean(). The former uses the virtual_cwd_globals
parameter passed in via the destructor, the latter uses the CWDG()
macro.
2021-05-25 11:40:28 +02:00
Joe Watkins 531413f809 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81076 Invalid implicit binds cause incorrect count in static vars of closure debug info
2021-05-25 11:27:20 +02:00
Joe Watkins 213063f6ca Fix #81076 Invalid implicit binds cause incorrect count in static vars of closure debug info 2021-05-25 11:26:38 +02:00
Joe Watkins 6408ebb731 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #77627 method_exists on Closure::__invoke
2021-05-25 11:23:08 +02:00
Joe Watkins cfd4d3df0b Fix #77627 method_exists on Closure::__invoke 2021-05-25 11:22:05 +02:00
DannyS712 724230d9a4 zend_language_parser.y: Fix a documentation typo
"loading" should be "leading" when discussing separators in namespace names
2021-05-25 10:08:59 +02:00
Nikita Popov 1fb9f5f93e Revert "Fix edge cases in JIT for ASSIGN_DIM_OP."
This reverts commit 4744dc8d21.

This seems to have broken some tests in sapi/fpm, and also causes
the test runner to get killed.
2021-05-24 20:46:42 +02:00
Christoph M. Becker e4e965039b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix some imagecolor*() return types
2021-05-24 14:21:29 +02:00
Christoph M. Becker 8bcaaa3579 Fix some imagecolor*() return types
These functions either return always a valid color, or `-1` on failure,
but never `false`.

Closes GH-7041.
2021-05-24 14:19:29 +02:00
Dmitry Stogov 4744dc8d21 Fix edge cases in JIT for ASSIGN_DIM_OP.
(This fixes Zend/tests/bug79947.phpt and
Zend/tests/undef_index_to_exception.phpt without PROFITABILITY_CHECKS).
2021-05-24 13:35:04 +03:00
Dmitry Stogov 88631e329b DynASM/ARM64: Fix ADRP encoding with absolute address.
(Switch to Mike Pall's version)
2021-05-24 10:17:52 +03:00
Máté Kocsis bf42cf5ae0 Merge branch 'PHP-8.0'
* Fix imagesetclip() parameter names
2021-05-23 19:41:25 +02:00
Máté Kocsis 25e24715d7 Fix imagesetclip() parameter names
Closes GH-7035
2021-05-23 19:40:12 +02:00
Máté Kocsis 78ecd4a5f0 Declare tentative return types for ext/reflection
Closes GH-7011
2021-05-23 15:59:57 +02:00
Christoph M. Becker d61d21ad57 Merge branch 'PHP-8.0'
* PHP-8.0:
  SimpleXMLElement::addAttribute() is a void function
2021-05-22 22:31:51 +02:00
Christoph M. Becker 24d9527c75 SimpleXMLElement::addAttribute() is a void function
Closes GH-7033.
2021-05-22 22:28:34 +02:00
Christoph M. Becker dff0798552 Merge branch 'PHP-8.0'
* PHP-8.0:
  Update version in php_version.h as well
2021-05-22 15:48:13 +02:00
Christoph M. Becker dcdac65dab Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Update version in php_version.h as well
2021-05-22 15:47:35 +02:00
Christoph M. Becker 59522ba968 Update version in php_version.h as well
The version there is automatically updated during `./configure`, but
not on Windows.
2021-05-22 15:42:57 +02:00
Christoph M. Becker a375d54785 Migrate skip checks to --EXTENSIONS-- for ext/gd
Cf. PR #6787.

Closes GH-6994.
2021-05-22 15:38:51 +02:00
Nikita Popov a0c44fbaf1 Always define valgrind replacement symbol for zend_string_equal_val
The required symbol name seems to be very stable, so we can hardcode
a fallback. This avoids many false positives when PHP is not built
against valgrind.
2021-05-21 21:00:34 +02:00
Joe Watkins 1bfaba4134 Merge branch 'master' of github.com:php/php-src
* 'master' of github.com:php/php-src:
  Fix upload_2G test
2021-05-21 16:07:45 +02:00
Joe Watkins 4d883a0eba note in upgrading for b227a72285 2021-05-21 16:05:56 +02:00
Nikita Popov 1af891306a Fix upload_2G test
Include the new full_path key. This test is skipped on CI but
fails locally.
2021-05-21 16:02:40 +02:00
Joe Watkins b227a72285 ReflectionFunctionAbstract::getClosureUsedVariables
Make a distinction at compile time between bind types for static
  variables

  getStaticVariables remains unchanged

  Fixes #80071
2021-05-21 15:25:35 +02:00
Dmitry Stogov 77ce2537f7 Merge branch 'PHP-8.0'
* PHP-8.0:
  Disable ASSIGN + SEND_VAL fusion for cases when destroying of old value may throw an exception.
2021-05-21 13:38:50 +03: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
David CARLIER 90b843beb6 Add FreeBSD to CI (#6974)
This is using Cirrus, as none of the CI providers we already use support FreeBSD.
2021-05-21 12:00:46 +02:00
Hao Sun 3ce26d80b7 JIT/AArch64: [macos] Fix arguments to variadic function (#7023)
zend_throw_error() and zend_error() are variadic functions. In Linux,
arguments are passed in registers, whereas they must be put on stack in
Macos [1][2].

In this patch:
1. preprocessor macro "__APPLE__" is used to distinguish the OS.
2. the third argument "CARG3" is the only variadic argument and put on
stack.
3. the invocation of zend_error() is converted back to regular call in
zend_jit_undefined_offset_stub() and zend_jit_undefined_index_stub().

With this patch, all ~4k test cases can pass for "nonZTS+CALL"
functional/tracing JIT with Macos Apple Silicion.

[1]
https://developer.apple.com/documentation/xcode/writing-arm64-code-for-apple-platforms#Overview
[2] https://github.com/below/HelloSilicon#listing-9-1

Change-Id: I49bc3233fc253ad3e77e8664464ff3e830dcd183
2021-05-21 17:59:15 +08:00
Nikita Popov b849aa6494 Merge branch 'PHP-8.0'
* PHP-8.0:
  Pass flags to #[Attribute] on internal attributes
2021-05-21 11:42:11 +02:00
Nikita Popov db6e60e744 Pass flags to #[Attribute] on internal attributes
While the specified restriction was checked, the #[Attribute]
attribute did not specify the flags parameter, so that Reflection
returned incorrect information.

In particular, Attribute itself has a CLASS target, not an ALL
target.
2021-05-21 11:40:23 +02:00
Nikita Popov b97a080034 Remove special UNREACHABLE_FREE handling in block pass
This results in an assertion failure when running under -e,
because there is an additional EXT_STMT + NOP before the FREE.
I don't think there's a strong reason to handle UNREACHABLE_FREE
specially here (it's only important that we *do* handle it), so
I'm dropping the code rather than adjusting it to scan over
certain opcodes.
2021-05-21 11:10:32 +02:00
Nikita Popov 9f263411eb XFAIL two intl tests on FreeBSD
These tests fail with the following diff:

========DIFF========
     date:  Tuesday, July 7, 2009 8:41:13 PM EDT
002+ msgf:  Wednesday, July 8, 2009 12:41:13 AM utc
002- msgf:  Tuesday, July 7, 2009 8:41:13 PM usnyc
========DONE========
FAIL Bug #58756: w.r.t MessageFormatter [ext/intl/tests/bug58756_MessageFormatter_variant2.phpt]

========DIFF========
001+ quinta-feira, 17 de maio de 2012 4:35:36 da tarde utc
001- quinta-feira, 17 de maio de 2012 5:35:36 da tarde ptlis
========DONE========
FAIL MessageFormat accepts IntlCalendar args [ext/intl/tests/msgfmt_format_intlcalendar_variant4.phpt]

That is, it appears that the timezone does not get applied. I don't
know why this happens, and don't want to spend more time trying to
figure this out.
2021-05-21 10:36:33 +02:00
Dmitry Stogov 0b4706819b 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:12:22 +03:00
Dmitry Stogov e9d171805a Merge branch 'PHP-8.0'
* PHP-8.0:
  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:10:20 +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
Derick Rethans b624473b3e Merge branch 'PHP-8.0' 2021-05-21 09:03:31 +01:00
Derick Rethans 2b4acf0cee Merge branch 'detect_musl_and_turn_off_tls_attribute' into PHP-8.0 2021-05-21 09:03:23 +01:00
Derick Rethans 804420b011 Detect musl libc to not set tls_model attribute on that platform
This fixes:
``_tsrm_ls_cache: initial-exec TLS resolves to dynamic definition``
in shared extensions.
2021-05-21 09:02:46 +01:00
Dmitry Stogov ab1827f3d4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Add missing undefined variable warning an result initialization. (This fixes Zend/tests/bug78531.phpt without PROFITABILITY_CHECKS).
2021-05-21 10:04:38 +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
Hao Sun b8a29319a7 JIT/AArch64: Fix typo in commit dc0e259 (#7021)
PHP JIT/AArch64 building is broken. Instruction "beq" should be used.

Change-Id: I16c00f87bafb3a565141e1e02c9e15653f39a276
2021-05-21 14:06:33 +08:00
Dmitry Stogov 6881a002d4 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't assign to string offset after exception (This fixes Zend/tests/bug31098.phpt failure without PROFITABILITY_CHECKS)
2021-05-21 00:49:44 +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 dc0e259154 Merge branch 'PHP-8.0'
* PHP-8.0:
  JIT: Fixed incorrect condition (this leaded to Zend/tests/type_declarations/typed_properties_083.phpt failure without PROFITABILITY_CHECKS)
2021-05-21 00:02:46 +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 cb376d8f61 Fixed Zend/tests/type_declarations/union_types/incdec_prop.phpt failure
masked by PROFITABILITY_CHECKS.
2021-05-20 22:52:47 +03:00
Dmitry Stogov 6be0278332 Fixed 32-bit x86 disassembler 2021-05-20 20:17:50 +03:00