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

16336 Commits

Author SHA1 Message Date
twosee a38aaf6cbd Merge branch 'PHP-8.0'
* PHP-8.0:
  EXTERN_C wrapping for GC buffer APIs
2020-12-10 17:16:08 +08:00
twosee 26c7b9402d EXTERN_C wrapping for GC buffer APIs
Closes GH-6502.
2020-12-10 17:15:19 +08:00
hgsgtk 6992c38ecc Fix typo 'variabled' in named_params/undef_var.phpt
Closes GH-6499.
2020-12-09 19:29:07 +01:00
Nikita Popov 174832902c Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix removal of type source during unserialization
2020-12-04 12:57:37 +01:00
Nikita Popov 77325c4448 Fix removal of type source during unserialization
Missed a check for info in this code. Add it, and add an assertion
in type source removal to make it easier to catch this issue.

Fixes oss-fuzz #28208 and #28257.
2020-12-04 12:56:05 +01:00
Nikita Popov 2dcf71cbfd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80462
2020-12-02 10:19:42 +01:00
Nikita Popov 7a61984a2b Fixed bug #80462 2020-12-02 10:19:32 +01:00
Sara Golemon 1071d85764 Flesh out HashTable insertion APIs
Fills out the array/object-property insert helpers for zend_array, zend_object, and zend_reference.

This adds the following matrix of 18 APIs
add_next_index_T()
add_index_T()
add_assoc_T()
add_assoc_T_ex()
add_property_T()
add_property_T_ex()

Where T in array, object, reference

Converted internal callsites currently doing an explicit object wrap.
2020-12-01 18:36:21 +00:00
Dmitry Stogov 5b078e7858 Merge branch 'PHP-8.0'
* PHP-8.0:
  Disable stack reuse optimization for x86 PIC code. It may clobber local variable used for Global Offset Table.
2020-12-01 15:26:37 +03:00
Dmitry Stogov 8ad2b59e12 Disable stack reuse optimization for x86 PIC code. It may clobber local variable used for Global Offset Table. 2020-12-01 15:20:06 +03:00
Nikita Popov 715d89e166 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't use scope when validating Attribute
2020-12-01 11:50:22 +01:00
Nikita Popov f06afc434a Don't use scope when validating Attribute
This is not safe to do at this point. Even if we made it safe,
we'd see inconsistencies due to a partially compiled class.

Fixes oss-fuzz #28129.
2020-12-01 11:49:27 +01:00
Nikita Popov 1912ff5ccb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix use after free with file cache and arena allocated strings
2020-12-01 11:32:28 +01:00
Nikita Popov 5dfec886d6 Fix use after free with file cache and arena allocated strings 2020-12-01 11:31:23 +01:00
codinghuang 3c6ab4b3ea Add const modifier for zend_extension members
Closes GH-6462.
2020-12-01 10:40:26 +01:00
Nikita Popov c034f200aa Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't mark cpu_supports functions as always inline
2020-12-01 10:24:02 +01:00
Nikita Popov 648cda6c9f Don't mark cpu_supports functions as always inline
The use of no-sanitize may result in an inlining failure, which
will be promoted into a compile error by always-inline. Use a
normal inlining hint without enforcing it.
2020-12-01 10:22:36 +01:00
Dmitry Stogov e1656bac7d Merge branch 'PHP-8.0'
* PHP-8.0:
  Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue.
2020-11-30 17:56:32 +03:00
Dmitry Stogov 841b00f641 Preallocate stack space for JIT in execute_ex() to eliminate JIT prologue/epilogue. 2020-11-30 17:56:08 +03:00
Nikita Popov 16795a2f83 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix build for non-x86
2020-11-27 17:04:56 +01:00
Nikita Popov 08919578ca Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix build for non-x86
2020-11-27 17:04:50 +01:00
Nikita Popov 3430d856ac Fix build for non-x86 2020-11-27 17:04:17 +01:00
Nikita Popov 3459099541 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix AVX detection
2020-11-27 14:49:57 +01:00
Nikita Popov 4f3cf983dc Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix AVX detection
2020-11-27 14:49:45 +01:00
Nikita Popov 4e30ab33d8 Fix AVX detection
Our CPU detection code currently only checks whether hardware
support for AVX exists. However, we also need to check for operating
system support for XSAVE, as well as whether XCR0 has the SSE and
AVX bits set.

If this is not the case, unset the AVX and AVX2 bits in the cpuinfo
structure.

Hopefully this resolves our issues with CPU support detection.

Closes GH-6460.
2020-11-27 14:49:31 +01:00
Nikita Popov 497a0e5a0e Merge branch 'PHP-8.0'
* PHP-8.0:
  Make sure zend_cpu_supports_pclmul() is always defined
2020-11-27 12:22:53 +01:00
Nikita Popov 8e25cf26af Make sure zend_cpu_supports_pclmul() is always defined
If __builtin_cpu_supports() is available, but doesn't have support
for pclmul, the function would end up not being defined at all.
2020-11-27 12:22:03 +01:00
Nikita Popov 9234446ca0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid direct calls to zend_cpu_supports()
  Assert that cpuinfo is initialized before use
  Move avx check into a macro
2020-11-27 11:19:56 +01:00
Nikita Popov f35b194029 Assert that cpuinfo is initialized before use
And fix some incorrect indentation.
2020-11-27 11:14:07 +01:00
Sara Golemon c65f0c7aca Remove -dev from ZEND_VERSION 2020-11-26 02:19:51 +00:00
Nikita Popov 7db29d2186 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80377
2020-11-25 11:48:51 +01:00
Nikita Popov 4633e70ab1 Fixed bug #80377
Make sure the $PHP_THREAD_SAFETY variable is always available
when configuring extensions. It was previously available for
phpized extensions, but for in-tree builds it was being set
too late.

Then, use $PHP_THREAD_SAFETY instead of $enable_zts to check for
ZTS in bundled extensions, which makes sure these checks also
work for phpize builds.
2020-11-25 11:47:05 +01:00
Nikita Popov fa713ec17b Fixed bug #80362: Running dtrace scripts can cause php to crash
Patch by al at coralnet dot name.
2020-11-24 13:01:51 +01:00
Nikita Popov 61a3cff2fb Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80404
2020-11-24 11:38:50 +01:00
Nikita Popov 03f8bccaf5 Fixed bug #80404
For a division like [1..1]/[2..2] produce [0..1] as a result, which
would be the integer envelope of the floating-point result.

The implementation is pretty ugly (we're now taking min/max across
eight values...) but I couldn't come up with a more elegant way
to handle this that doesn't make things a lot more complex (the
division sign handling is the annoying issue here).
2020-11-24 11:35:44 +01:00
Nikita Popov 679bb56858 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80391
2020-11-24 10:10:01 +01:00
Nikita Popov 912cb8b8b5 Fixed bug #80391
Iterable was not considered a subtype of array|object, and thus
also not a subtype of mixed.
2020-11-24 10:09:28 +01:00
Máté Kocsis 2e4d44509b Merge branch 'PHP-8.0' 2020-11-21 23:17:55 +01:00
Máté Kocsis 40ebfd6730 Remove some incorrect mixed parameter types 2020-11-21 23:17:35 +01:00
Nikita Popov 72ce6a131e Merge branch 'PHP-8.0'
* PHP-8.0:
  Export zend_is_callable_at_frame
2020-11-19 10:30:38 +01:00
Nikita Popov 46b9e0c874 Export zend_is_callable_at_frame
Export the zend_is_callable_impl() function as
zend_is_callable_at_frame() for use by extension. As twose pointed
out, an extension may want to retrieve fcc for a private method.
2020-11-19 10:29:32 +01:00
Nikita Popov a6bcad4a9e Merge branch 'PHP-8.0'
* PHP-8.0:
  Short-circuit get_gc for currently running generator
2020-11-18 12:46:32 +01:00
Nikita Popov bbc0dd402a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Short-circuit get_gc for currently running generator
2020-11-18 12:46:12 +01:00
Nikita Popov 99a8ec6e24 Short-circuit get_gc for currently running generator 2020-11-18 12:45:29 +01:00
Nikita Popov 5bd7305cf0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Provide unused retvals to observers
2020-11-17 10:30:20 +01:00
Sammy Kaye Powers 58d41b8c4f Provide unused retvals to observers
Make sure that the return value is available to observers, even if
it is not used by the caller.

Closes GH-6422.
2020-11-17 10:28:47 +01:00
Nikita Popov c4b2a40fdd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix incorrectly optimized out live range
2020-11-17 10:20:52 +01:00
Nikita Popov 9cfb5261e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix incorrectly optimized out live range
2020-11-17 10:20:23 +01:00
Nikita Popov df7417d127 Fix incorrectly optimized out live range
For x ? y : z style structures, the live range starts at z, but
may also hold the value of y. Make sure that the refcounting check
takes this into account, by checking the type of a potential phi
user.
2020-11-17 10:19:57 +01:00
Sammy Kaye Powers e974becbb1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fire open observer end handlers after a zend_bailout
2020-11-16 15:13:29 -08:00