Commit graph

18012 commits

Author SHA1 Message Date
Pierrick Charron
dc054488da
PHP-8.2 is now for PHP 8.2.4-dev 2023-02-14 10:02:46 -05:00
Dmitry Stogov
e3aa73904a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix updating SSA object type for *_ASSIGN_OP (#10458)
2023-02-14 11:29:47 +03:00
Niels Dossche
d94ddbed2c
Fix updating SSA object type for *_ASSIGN_OP (#10458)
The code fetched the class entry into ce for objects and static
properties. However, when the actual update needs to take place (when
result_def exists), the class entry in ce was reset to NULL. So the SSA
object type update never happened. Fetch the class entry in the
result_def>=0 case instead after the reset of ce to NULL.
2023-02-14 11:29:29 +03:00
Ben Ramsey
28d68f5013
PHP-8.1 is now for PHP 8.1.17-dev 2023-02-13 13:16:07 -06:00
Bob Weinand
98b8d1c152 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-13 16:34:19 +00:00
Bob Weinand
95016138a5 Fix GH-10496: Fibers must not be garbage collected while implicitly suspended by resumption of another fiber 2023-02-13 16:30:21 +00:00
Bob Weinand
0e31e03bc5 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-13 13:10:08 +01:00
Arnaud Le Blanc
d721dcc2ef Fix colletion of unfinished function call in fibers
Fixes GH-10496.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
2023-02-13 13:09:04 +01:00
Ilija Tovilo
b9d1eca8fd
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Mark test as XFAIL
2023-02-11 00:21:59 +01:00
Ilija Tovilo
13c34aac05
Mark test as XFAIL
See https://github.com/php/php-src/pull/10546
2023-02-11 00:21:01 +01:00
Ilija Tovilo
972a5a02bd
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
2023-02-08 01:12:03 +01:00
Niels Dossche
71ddede565
Fix GH-10168: heap-buffer-overflow at zval_undefined_cv
The problem is that we're using the variable_ptr in the opcode handler
*after* it has already been destroyed. The solution is to create a
specialised version of zend_assign_to_variable which takes in two
destination zval pointers.

Closes GH-10524
2023-02-08 01:06:50 +01:00
Max Kellermann
0752baa583 Zend/zend_cpuinfo, ext/standard/crc32_x86: fix -Wstrict-prototypes
In plain C, a function without arguments must be explicitly declared
(void).

Close GH-10528
2023-02-07 22:47:43 +00:00
David Carlier
c6f0e89f16 Merge branch 'PHP-8.1' into PHP-8.2 2023-02-05 16:41:34 +00:00
Niels Dossche
49551d7c29 Sync boost/context assembly files for fibers
Fixes GH-10398

The stack was misaligned upon entering the trampoline function [1], this
causes a CPU trap when the SSE instruction is executed to copy data from
the stack. This was fixed upstream [2]. This commit syncs all upstream
changes from the boost/context assembly files to our copy.

[1] https://github.com/php/php-src/pull/10407#issuecomment-1404180877
[2] https://github.com/boostorg/context/pull/219

Closes GH-10407.
2023-02-05 16:40:54 +00:00
Bob Weinand
f732486c08 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-30 12:33:06 +01:00
Bob Weinand
00be6e1aed Look at executing generator for fiber destructor behaviour 2023-01-30 12:32:53 +01:00
Bob Weinand
e746b89bc9 Merge branch 'PHP-8.1' into PHP-8.2 2023-01-30 12:13:41 +01:00
Bob Weinand
b9bca2dadb Fix resetting ZEND_GENERATOR_IN_FIBER flag
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-01-30 12:13:07 +01:00
Dmitry Stogov
55e3f73109 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix type inference
2023-01-30 13:16:05 +03:00
Dmitry Stogov
81607a62ca Fix type inference
Fixes oss-fuzz #55358
2023-01-30 13:15:05 +03:00
Aaron Piotrowski
0c4aee464a
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix GH-10437: Set active fiber to null on bailout (#10443)
2023-01-28 10:16:04 -06:00
Aaron Piotrowski
284c29328e
Fix GH-10437: Set active fiber to null on bailout (#10443) 2023-01-28 10:13:58 -06:00
Arnaud Le Blanc
6c22dea3c1 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix overflow check in OnUpdateMemoryConsumption (#10456)
  Prevent dtor of generator in suspended fiber (#10462)
2023-01-27 19:37:01 +01:00
Arnaud Le Blanc
1173c2e64a
Prevent dtor of generator in suspended fiber (#10462)
Generators that suspended a fiber should not be dtor because they will be
executed during the fiber dtor.

Fiber dtor throws an exception in the fiber's context in order to unwind and
execute finally blocks, which will also properly dtor the generator.

Fixes GH-9916
2023-01-27 19:32:25 +01:00
Arnaud Le Blanc
ab2097df48 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Handle non-INDIRECT symbol table entries in zend_fiber_object_gc() (#10386)
2023-01-27 10:55:30 +01:00
Arnaud Le Blanc
9830204213
Handle non-INDIRECT symbol table entries in zend_fiber_object_gc() (#10386)
Fixes GH-10340
2023-01-27 10:52:42 +01:00
David Carlier
fe9b622e7a zend extension build warning fix.
clang is more picky in this case but at least it makes it more consistent overall.
2023-01-25 20:59:08 +00:00
Niels Dossche
972c74c300
Fix incorrect check in zend_internal_call_should_throw()
This debug code is part of arginfo validation. This validation will
never trigger properly because the OR operation makes the first if
always true. Fix it by changing to an AND.

Closes GH-10417

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-25 00:12:13 +00:00
Dmitry Stogov
227b3b3281 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check condition in type inference (#10425)
2023-01-24 09:32:26 +03:00
Niels Dossche
2787e3cd65
Fix incorrect check condition in type inference (#10425)
The "nothing to do" case would never be hit because the switch block
would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP,
not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to
the else block. Fix this by correcting the check condition.
2023-01-24 09:32:07 +03:00
Arnaud Le Blanc
c2e77f9c0f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  [ci skip] NEWS
  Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
2023-01-20 16:52:52 +01:00
Niels Dossche
0801c567dc Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
The assertion failure was triggered in a debug code-path that validates
property types for internal classes.
zend_verify_internal_read_property_type was called with retval being a
reference, which is not allowed because that function eventually calls to
i_zend_check_property_type, which does not expect a reference.
The non-debug code-path already takes into account that retval can be a
reference, as it optionally dereferences retval.

Add a dereference in zend_verify_internal_read_property_type just before
the call to zend_verify_property_type, which is how other callers often
behave as well.
2023-01-20 16:40:15 +01:00
Christoph M. Becker
66605994ad
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check condition in ZEND_YIELD
2023-01-18 16:28:04 +01:00
Niels Dossche
b5e9bf7775
Fix incorrect check condition in ZEND_YIELD
The condition `UNEXPECTED(Z_TYPE_P(key)) == IS_REFERENCE` always
returned false, because `UNEXPECTED(expression)` always returns 0 or 1.
Move the parens so the comparison is executed properly.

Closes GH-10332.
2023-01-18 16:23:38 +01:00
Sergey Panteleev
eee988e86d
PHP-8.2 is now for PHP 8.2.3-dev 2023-01-17 20:55:22 +03:00
Patrick Allaert
c47a1a260d
PHP-8.1 is now for PHP 8.1.16-dev 2023-01-17 17:24:25 +01:00
Bob Weinand
a6a20c9e17 Add regression test for e560592a61
Reproduces only under ASAN.

Signed-off-by: Bob Weinand <bobwei9@hotmail.com>
2023-01-17 11:14:00 +01:00
David Carlier
385f410e4c Merge branch 'PHP-8.1' into PHP-8.2 2023-01-16 20:43:08 +00:00
Niels Dossche
dfe9c2af19 Fix incorrect comparison in block optimization pass
We're in the case of ZEND_JMPZ_EX or ZEND_JMPNZ_EX. The opcode gets
overwritten and only after the overwriting gets checked if we're in a
JMPZ or JMPNZ case. This results in a wrong optimization.

Close GH-10329
2023-01-16 20:41:33 +00:00
Petar Obradović
e560592a61 Fix GH-9675: Re-adjust run_time_cache init for internal enum methods
Closes GH-10143.
2023-01-16 17:38:38 +01:00
Arnaud Le Blanc
d89408075f Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
  GC fiber unfinished executions (#9810)
2023-01-13 12:28:21 +01:00
Arnaud Le Blanc
0f7625c47c
Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
zend_hash allocates a hash table twice as big as nTableSize
(HT_HASH_SIZE(HT_SIZE_TO_MASK(nTableSize)) == nTableSize*2), so HT_MAX_SIZE
must be half the max table size or less.

Fixes GH-10240
2023-01-13 12:05:51 +01:00
Arnaud Le Blanc
4fb149390a
GC fiber unfinished executions (#9810) 2023-01-13 12:04:28 +01:00
David Carlier
884e8a970a Merge branch 'PHP-8.1' into PHP-8.2 2023-01-12 22:01:30 +00:00
Niels Dossche
833b45ac44 Fix GH-10249: Assertion `size >= page_size + 1 * page_size' failed.
Co-authored-by: Changochen <changochen1@gmail.com>

Closes GH-10284
2023-01-12 22:00:00 +00:00
George Peter Banyard
c936c02119
Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  fix: indirect_return compilation warning
2023-01-10 15:23:35 +00:00
Kévin Dunglas
55514a1119
fix: indirect_return compilation warning
Closes GH-10274

Signed-off-by: George Peter Banyard <girgias@php.net>
2023-01-10 15:23:15 +00:00
Dmitry Stogov
9abc2108fa Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values)
2023-01-09 13:53:19 +03:00
Dmitry Stogov
4d4a53beee Fix incorrect optimization of ASSIGN_OP may lead to incorrect result (sub assign -> pre dec conversion for null values) 2023-01-09 13:51:57 +03:00