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

18153 Commits

Author SHA1 Message Date
Arnaud Le Blanc 95ccce3c13 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  [ci skip] NEWS
  Fix GH-10248: Assertion `!(zval_get_type(&(*(property))) == 10)' failed.
2023-01-20 16:55:11 +01: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
Alex Dowad 0b7986f976 Tweak SSE2-accelerated strtoupper() and strtolower() for speed
I learned this trick for doing a faster bounds check with both upper
and lower bounds by reading a disassembler listing of optimized code
produced by GCC; instead of doing 2 compares to check the upper and the
lower bound, add an immediate value to shift the range you are testing
for to the far low or high end of the range of possible values for the
type in question, and then a single compare will do. Intstead of
compare + compare + AND, you just do ADD + compare.

From microbenchmarking on my development PC, this makes strtoupper()
about 10% faster on long strings (~10,000 bytes).
2023-01-20 08:21:45 +02:00
Niels Dossche 9f02a11846 Fix incorrect UNEXPECTED paren placement in zend_gc.c
Closes GH-10371.
2023-01-18 19:42:20 +01:00
Christoph M. Becker 7d3a7efd4a Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix incorrect check condition in ZEND_YIELD
2023-01-18 16:28:42 +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
Niels Dossche 8d21a6b2ab Fix UNEXPECTED() paren mistakes.
This corrects the paren placement to the intended one.
As these functions use zend_result, the success value is zero. Therefore
this has no functional change. The only difference is that this now
hints the compiler optimizer correctly.

Closes GH-10364.
2023-01-18 15:14:44 +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 f833a7ea59 Merge branch 'PHP-8.2' 2023-01-17 11:14:18 +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 585ac794b4 Merge branch 'PHP-8.2' 2023-01-16 20:44:01 +00: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
Bob Weinand 277dc35541 Merge branch 'PHP-8.2' 2023-01-16 17:39:34 +01: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
George Peter Banyard 6556601b45 Add some const qualifiers and better return types to zend_object_handlers.h (#10330)
I initially wanted to add them to the zend_strings but because they are used in zend_hash_find() which might modify the hash field.
2023-01-16 13:55:12 +00:00
Christoph M. Becker 2d3427c507 Revert "#include cleanup (#10216)"
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit e628c66f9d.
2023-01-16 12:29:41 +01:00
Christoph M. Becker c8955c078a Revert GH-10220
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit ecc880f491.
This reverts commit 588a07f737.
This reverts commit f377e15751.
This reverts commit b4ba16fe18.
This reverts commit 694ec1deea.
This reverts commit 6b34de8eba.
This reverts commit aa1cd02a43.
This reverts commit 308fd311ea.
This reverts commit 16203b53e1.
This reverts commit 738fb5ca54.
This reverts commit 9fdbefacd3.
This reverts commit cd4a7c1d90.
This reverts commit 928685eba2.
This reverts commit 01e5ffc85c.
2023-01-16 12:27:33 +01:00
Christoph M. Becker 2f4973fd88 Revert GH-10279
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 45a128c9de.
This reverts commit 1eb71c3f15.
This reverts commit 492523a779.
This reverts commit c7a4633891.
This reverts commit 308adb915c.
This reverts commit cd27d5e07f.
This reverts commit c5933409b4.
This reverts commit 46371f4eb3.
This reverts commit 623e2e9fc6.
This reverts commit e7434c1247.
This reverts commit d28d323ca2.
This reverts commit 1a067b84ee.
This reverts commit a55c0c5fc3.
This reverts commit b5aeb3a4d4.
This reverts commit f061a035e4.
This reverts commit b088575119.
This reverts commit b1d48774a7.
This reverts commit 94f9a20ce6.
This reverts commit 4831e48708.
This reverts commit cd985de190.
This reverts commit 9521d21681.
This reverts commit d6136151e9.
2023-01-16 12:25:59 +01:00
Christoph M. Becker bf1cfc0753 Revert GH-10300
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 68ada76f9a.
his reverts commit 45384c6e20.
This reverts commit ef7fbfd710.
This reverts commit 9b9ea0d7c6.
This reverts commit f15747c26b.
This reverts commit e883ba93c4.
This reverts commit 7e87551c37.
This reverts commit 921274d2b8.
This reverts commit fc1f528e5e.
This reverts commit 0961715cda.
This reverts commit a93f264526.
This reverts commit 72dd94e1c6.
This reverts commit 29b2dc8964.
This reverts commit 05c7653bba.
This reverts commit 5190e5c260.
This reverts commit 6b55bf228c.
This reverts commit 184b4a12d3.
This reverts commit 4c31b7888a.
This reverts commit d44e9680f0.
This reverts commit 4069a5c43f.
2023-01-16 12:22:54 +01:00
George Peter Banyard 098a43dbd0 Introduce new INI API to get zend_string* value for an INI setting 2023-01-15 16:00:18 +00:00
Max Kellermann 68ada76f9a Zend/zend_closures: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 45384c6e20 Zend/zend_inheritance: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann ef7fbfd710 Zend/zend_API: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 9b9ea0d7c6 Zend/zend_list: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann f15747c26b Zend/zend_objects: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann e883ba93c4 Zend/zend_gc: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 7e87551c37 Zend/zend_llist: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 921274d2b8 Zend/zend_observer: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann fc1f528e5e Zend/zend_interfaces: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 0961715cda Zend/zend_enum: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann a93f264526 Zend/zend_weakrefs: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 72dd94e1c6 Zend/zend_compile: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 29b2dc8964 Zend/zend_iterators: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 05c7653bba Zend/zend_call_stack: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 5190e5c260 Zend/zend_ast: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 6b55bf228c Zend/zend_language_scanner: include cleanup 2023-01-15 15:07:58 +00:00
Max Kellermann 4c31b7888a Zend/zend_globals_macros: add missing include for BEGIN_EXTERN_C 2023-01-15 15:07:58 +00:00
Max Kellermann 4069a5c43f Zend/zend_execute: always include zend_globals.h
Commit ecc880f491 was incomplete; EG() is used in inline functions
outside of ZEND_DEBUG.
2023-01-15 15:07:58 +00:00
Niels Dossche a60c6ee0ac Mark constant static arrays in function bodies actually as const (#10325) 2023-01-15 14:51:31 +00:00
Arnaud Le Blanc a493da7b9d Fix typo in HAVE_ macro (#10310) 2023-01-14 13:43:26 +01:00
Arnaud Le Blanc 2b1907786c zend_hash_check_size: allow nSize <= HT_MAX_SIZE (#10244)
This is consistent with other uses of HT_MAX_SIZE
2023-01-13 17:42:43 +01:00
Max Kellermann 7473b86f10 build/php.m4: remove test for integer types (#10304)
These are mandatory in C99, so it's a pointless waste of time to check
for them.

(Actually, the fixed-size integer types are not mandatory, but if they
are really not available on some theoretical system, PHP's fallbacks
won't work either, so nothing is gained from this check.)
2023-01-13 11:51:15 +00:00
Arnaud Le Blanc ba091ab3c7 Merge branch 'PHP-8.2'
* PHP-8.2:
  [ci skip] NEWS
  Reduce HT_MAX_SIZE to account for the max load factor of 0.5 (#10242)
  GC fiber unfinished executions (#9810)
2023-01-13 12:31:12 +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