Commit graph

573 commits

Author SHA1 Message Date
Niels Dossche
2ec8d37eb4
Fix GH-18107: Opcache CFG jmp optimization with try-finally breaks the exception table
If there's a try-finally where the try_op starts on a basic block with a
single JMP, and the JMP optimization causes that basic block to become
unreachable, then we update try_op.
In this case, there is no catch_op, so try_op is erroneously set to 0,
we should instead set it to `b->start`.

Closes GH-18110.
2025-03-21 13:56:31 +01:00
Ilija Tovilo
cdfd960150
Fix ZEND_MATCH_ERROR misoptimization
op1 of ZEND_MATCH_ERROR, which refers to the match expression, is not freed by
MATCH_ERROR itself. Instead, it is freed by ZEND_HANDLE_EXCEPTION. For normal
control flow, a FREE is placed at the end of the match expression.

Since FREE may appear after MATCH_ERROR in the opcode sequence, we need to
correctly handle op1 of MATCH_ERROR as alive.

Fixes GH-17106
Closes GH-17108
2024-12-12 13:10:34 +01:00
Dmitry Stogov
920e3d6b70
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:31 +03:00
Dmitry Stogov
fe513655dc
Fix GH-16499: [JIT] Undefined to null coercion issues for return 2024-10-21 14:50:50 +03:00
Ilija Tovilo
c5745f40a5
Fix array to string conversion warning emitted in optimizer
Fixes GH-16408
Closes GH-16380
2024-10-14 13:24:05 +02:00
Niels Dossche
75f5cbf89e
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2024-09-09 20:12:01 +02:00
Niels Dossche
86ef8d5466
Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
Closes GH-15666.
2024-09-09 20:10:16 +02:00
Bob Weinand
61b455b59c Merge branch 'PHP-8.2' into PHP-8.3 2024-07-22 18:30:10 +02:00
Bob Weinand
a18df90a8b Fix GH-13817: Segmentation fault for enabled observers after pass 4
Instead of fixing up temporaries count in between observer steps, just apply the additional temporary in the two affected observer steps.

Closes GH-14018.
2024-07-22 18:28:03 +02:00
Niels Dossche
f21947a7ae
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-15028: Memory leak in ext/phar/stream.c
  Fix GH-15023: Memory leak in Zend/zend_ini.c
  Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
2024-07-19 14:59:44 +02:00
Niels Dossche
03d73182d9
Fix GH-15020: Memory leak in Zend/Optimizer/escape_analysis.c
Closes GH-15022.
2024-07-19 14:56:28 +02:00
Ilija Tovilo
a351121e85
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed missed exception
2024-04-15 17:44:03 +02:00
Dmitry Stogov
5f9b9c4e23
Fixed missed exception 2024-04-15 17:43:54 +02:00
Ilija Tovilo
3a5edcca47
Fix create_object checks
Since PHP 8.3, object handlers may be changed by setting
ce->default_object_handlers, rather than in ce->create_object. Some checks need
to be extended to check for the default handlers.

Closes GH-13272
2024-01-30 16:13:51 +01:00
Ilija Tovilo
42cbace1ad
Fix range inference since "proper-range-semantics" RFC
* Arrays returned from range are never empty
* When step is a double value representable by a long, it is coerced implicitly.
  As such, passing a double step no longer guarantees that the result is a
  non-int array.

Closes GH-13166
2024-01-17 15:42:17 +01:00
Dmitry Stogov
b046143529 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix zend_may_throw() for FETCH_DIM_IS and ISSET_ISEMPTY_DIM_OBJ
2024-01-17 00:32:14 +03:00
Dmitry Stogov
b33e3eb8c2 Fix zend_may_throw() for FETCH_DIM_IS and ISSET_ISEMPTY_DIM_OBJ
Recentlty this insructions were updated to emit warning on inability to
convert double index to long. This may lead to exception.

This fixes memory leak on wordpress test suite (nightly workflow)
2024-01-17 00:19:43 +03:00
Niels Dossche
fc82c27a3d Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-12953: SSA integrity verification failed when loading composer classmaps with more than 11k elements
2023-12-18 13:15:19 +01:00
Niels Dossche
7585cf6952 Fix GH-12953: SSA integrity verification failed when loading composer classmaps with more than 11k elements
This is a false positive. The cycle detection code stops at 10.000
iterations. Instead of stopping at a fixed amount, make it more robust
by implementing Floyd's cycle detection algorithm.

Closes GH-12954.
2023-12-18 13:14:51 +01:00
Dmitry Stogov
555e8f82e8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed type inference
2023-12-18 12:28:25 +03:00
Dmitry Stogov
731734dacb Fixed type inference
Fixes oss-fuzz #65150
2023-12-18 12:27:35 +03:00
Dmitry Stogov
8c9b5996be Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed type inference
2023-12-01 17:09:09 +03:00
Dmitry Stogov
1e55c97601 Fixed type inference
Fixes oss-fuzz #64577, #64579, #64589
2023-12-01 17:08:16 +03:00
Dmitry Stogov
64851873da Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-8251: Narrowing occurred during type inference of ZEND_FETCH_DIM_W
2023-11-28 23:33:45 +03:00
Dmitry Stogov
423a1e586e Fixed GH-8251: Narrowing occurred during type inference of ZEND_FETCH_DIM_W 2023-11-28 22:49:39 +03:00
Alex Dowad
31d43164e8 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Return value of mb_get_info can be NULL
2023-11-27 21:13:21 +02:00
Alex Dowad
d8ef868b92 Return value of mb_get_info can be NULL
This has been the case at least since PHP 5.4. Thanks to Girgias for
pointing it out.

It appears that there are several global variables internal to mbstring
which can be queried via mb_get_info() and which could be NULL, but
at the very least, we know that "mbstring.http_input" is one of them.
2023-11-27 20:53:37 +02:00
Dmitry Stogov
9717e9fd56 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed empty array inference
2023-11-08 22:04:09 +03:00
Dmitry Stogov
5a77870492 Fixed empty array inference 2023-11-08 22:03:42 +03:00
Ilija Tovilo
cb1e842929
Fix inference of COPY_TMP
Since GH-11592 COPY_TMP may receive and thus define references. Unfortunately,
the name COPY_TMP is no longer accurate.

Closes GH-12619
2023-11-07 12:02:45 +01:00
Dmitry Stogov
86f71e51d4 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Remove spaces
2023-11-03 10:58:32 +03:00
Dmitry Stogov
7e5fb564d6 Remove spaces 2023-11-03 10:58:20 +03:00
Dmitry Stogov
4ee72a8dda Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport fix for HASH/PACKED array inference through MAY_BE_ARRAY_EMPTY flag (#12591)
2023-11-03 10:55:33 +03:00
Dmitry Stogov
6bf4041398 Backport fix for HASH/PACKED array inference through MAY_BE_ARRAY_EMPTY flag (#12591)
* Fixed HASH/PACKED array inference through MAY_BE_ARRAY_EMPTY flag

This fixes GH-12527

* typo
2023-11-03 10:54:57 +03:00
Dmitry Stogov
22735b3ff5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
  ext/intl: change when the locale is invalid for the 8.1/8.2 serie.
2023-11-02 08:15:50 +03:00
Dmitry Stogov
177a6f5d8a Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT
2023-11-02 08:11:00 +03:00
Dmitry Stogov
798b9d097b Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT 2023-11-02 08:09:29 +03:00
Dmitry Stogov
916fa73d80 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed inorrect QM_ASSIGN elimination
2023-11-01 09:55:37 +03:00
Dmitry Stogov
125dbb2c03 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed inorrect QM_ASSIGN elimination
2023-11-01 09:55:28 +03:00
Dmitry Stogov
19dfe05f16 Fixed inorrect QM_ASSIGN elimination
Fixes oss-fuzz #63771
2023-11-01 09:54:58 +03:00
Dmitry Stogov
76112a15ae Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Backport implementation of iterative Pearce's SCC finding algoritm (#12528)
2023-10-31 09:59:47 +03:00
Dmitry Stogov
00352429ca Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Backport implementation of iterative Pearce's SCC finding algoritm (#12528)
2023-10-31 09:59:31 +03:00
Dmitry Stogov
52bb39e661 Backport implementation of iterative Pearce's SCC finding algoritm (#12528)
Fixes GH-11795
2023-10-31 09:54:44 +03:00
Dmitry Stogov
586b2f8645 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-12511: Use must be in next opline assertion with patched infection
2023-10-31 07:52:46 +03:00
Dmitry Stogov
14b36c8583 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed GH-12511: Use must be in next opline assertion with patched infection
2023-10-31 07:52:38 +03:00
Dmitry Stogov
b3b46a44c5 Fixed GH-12511: Use must be in next opline assertion with patched infection 2023-10-31 07:51:36 +03:00
Dmitry Stogov
e52d617934 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed GH-12509: JIT assertion when running php-parser tests
2023-10-26 23:59:12 +03:00
Dmitry Stogov
770c1b0361 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fixed GH-12509: JIT assertion when running php-parser tests
2023-10-26 23:59:03 +03:00
Dmitry Stogov
5f46d86955 Fixed GH-12509: JIT assertion when running php-parser tests 2023-10-26 23:58:29 +03:00
Dmitry Stogov
574b0573ac Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fixed incorrect type inference
2023-10-24 18:49:18 +03:00