1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00

2477 Commits

Author SHA1 Message Date
Gina Peter Banyard
f40b356ad9 Use smart_str_append() if we have a zend_string* (#21414) 2026-03-21 17:06:14 +00:00
Dmitry Stogov
c43880587b Update IR (#21462)
IR commit: 7fed7999743ba6a5ffc5535e786725d5577f6f34
2026-03-16 22:52:40 +03:00
Dmitry Stogov
0bd3a6b7f2 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix support for TAILCALL VM
  Fix GH-21267: JIT infinite loop on FETCH_OBJ_R with IS_UNDEF property (#21368)
2026-03-16 21:58:32 +03:00
Dmitry Stogov
00ff93d660 Fix support for TAILCALL VM 2026-03-16 21:57:40 +03:00
Dmitry Stogov
81504d3db7 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-21267: JIT infinite loop on FETCH_OBJ_R with IS_UNDEF property (#21368)
2026-03-16 21:32:27 +03:00
Ilia Alshanetsky
e1a3a4c9a4 Fix GH-21267: JIT infinite loop on FETCH_OBJ_R with IS_UNDEF property (#21368)
When the JIT defers the IS_UNDEF check for FETCH_OBJ_R to the result
type guard, the deoptimization escape path dispatches to opline->handler
via the trace_escape stub. If opline->handler has been overwritten with
JIT code (e.g. a function entry trace), this creates an infinite loop.

Fix by dispatching to the original VM handler (orig_handler from the
trace extension) instead of going through the trace_escape stub. This
avoids the extra IS_UNDEF guard on every property read while correctly
handling the rare IS_UNDEF case during deoptimization.

Also set current_op_array in zend_jit_trace_exit_to_vm so that the
blacklisted exit deoptimizer can resolve orig_handler, covering the
case where side trace compilation is exhausted.

Closes GH-21368.
2026-03-16 21:31:49 +03:00
Dmitry Stogov
79556df7ee Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
2026-03-11 15:23:22 +03:00
Dmitry Stogov
35ee95a827 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
2026-03-11 15:23:12 +03:00
Ilia Alshanetsky
80dc4c19d6 Fix GH-20838: JIT compiler produces wrong arithmetic results (#21383)
Insert type guards (CHECK_OP1_TRACE_TYPE / CHECK_OP2_TRACE_TYPE) on the
sensitive bailout paths in ADD/SUB/MUL JIT compilation: the MAY_BE_UNDEF
and non-numeric operand breaks. Guards are only emitted when the traced
operand type is IS_LONG or IS_DOUBLE, ensuring TSSA result type
predictions stay valid for side traces without affecting the normal
numeric fast path.


Fixes GH-20838

Co-authored-by: Dmitry Stogov <dmitrystogov@gmail.com>
2026-03-11 15:22:50 +03:00
Dmitry Stogov
031b4c66c4 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR
2026-02-25 17:19:52 +03:00
Dmitry Stogov
908723ad09 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR
2026-02-25 17:19:41 +03:00
Dmitry Stogov
f073425426 Update IR
IR commit: d8fbd3b198007f633a255b855cad036758deefb6

Fixes function JIT failures introduced by e792511179
2026-02-25 17:18:25 +03:00
Dmitry Stogov
68d96e3855 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#21288)
2026-02-24 18:41:57 +03:00
Dmitry Stogov
ff73aecc95 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#21288)
2026-02-24 18:41:43 +03:00
Dmitry Stogov
e792511179 Update IR (#21288)
IR commit: ef9341183cdd0489a188a87e74f5b02a359df21b
2026-02-24 18:40:53 +03:00
Ilija Tovilo
db0e365f5a Fix missing reference unwrap for FE_FETCH_R in JIT (GH-21265)
Fixes GH-21264
2026-02-24 02:15:07 +01:00
Dmitry Stogov
90e4f1a9e5 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#21183)
2026-02-10 01:35:01 +03:00
Dmitry Stogov
7273aa39c9 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#21183)
2026-02-10 01:34:45 +03:00
Dmitry Stogov
dd9421d825 Update IR (#21183)
IR commit: a098f9ed6c2f1c2852d6c0921283212aafb4afed
2026-02-10 01:34:09 +03:00
Ilija Tovilo
fcb50e4d62 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix OSS-Fuzz #478009707 for JIT
2026-02-08 16:47:06 +01:00
Ilija Tovilo
ba6df41144 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix OSS-Fuzz #478009707 for JIT
2026-02-08 16:46:52 +01:00
Ilija Tovilo
bbde9c8178 Fix OSS-Fuzz #478009707 for JIT
This issue was already fixed in GH-21124, but some JIT paths were missing.

Closes GH-21151
2026-02-08 16:46:08 +01:00
cui
7fed075ba6 [skip ci] typo: sucess* to success* (GH-21092) 2026-01-30 14:28:48 +01:00
Ilija Tovilo
aeb8524584 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix segfault in Tracing JIT with object reference (GH-20818)
2026-01-21 00:27:20 +01:00
Ilija Tovilo
2352cc1225 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix segfault in Tracing JIT with object reference (GH-20818)
2026-01-21 00:27:15 +01:00
Chris Hasiński
1db1c7f5c1 Fix segfault in Tracing JIT with object reference (GH-20818)
When FE_RESET_RW executes, it converts the CV to a reference before
checking if the array/object is empty. However, when the JIT creates
exit points for FE_RESET_RW in zend_jit_trace_handler(), it wasn't
updating the stack type for op1 to reflect this change.

This caused side traces compiled from these exit points to have
incorrect type information. The side trace's CV cleanup code would
see IS_OBJECT and generate a direct call to zend_objects_store_del(),
but the actual value was a zend_reference*, causing a segfault.

The fix adds ZEND_FE_RESET_RW to the list of opcodes that temporarily
set their op1 stack type to IS_UNKNOWN before creating exit points.
This follows the same pattern used for ZEND_BIND_INIT_STATIC_OR_JMP.
When IS_UNKNOWN, the JIT falls back to SSA type info which correctly
includes MAY_BE_REF for FE_RESET_RW's op1_def.

Fixes GH-20818
Closes GH-20948
2026-01-21 00:24:14 +01:00
Niels Dossche
9731f11807 Merge branch 'PHP-8.5'
* PHP-8.5:
  Revert "Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT"
2026-01-20 21:05:58 +01:00
Niels Dossche
fd5e45116b Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Revert "Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT"
2026-01-20 21:05:50 +01:00
Niels Dossche
32c0245531 Revert "Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT"
This reverts commit 57c62eb2b3.
2026-01-20 21:05:26 +01:00
Niels Dossche
c8952c7cb7 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT
2026-01-20 18:55:45 +01:00
Niels Dossche
77c9c8c6c0 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT
2026-01-20 18:55:39 +01:00
Niels Dossche
57c62eb2b3 Fix GH-20890: Segfault in zval_undefined_cv with non-simple property hook with minimal tracing JIT
This is similar to f6c2e40a11 but for minimal JIT + tracing JIT.
Most of the times the tracing JIT shouldn't rely on going to the VM, but
in some cases, like in minimal JIT, it can and then it hits the same
bug.

Closes GH-20897.
2026-01-20 18:55:08 +01:00
Dmitry Stogov
9d089a8d30 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#20916)
2026-01-12 21:24:04 +03:00
Dmitry Stogov
f7f0d228c2 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#20916)
2026-01-12 21:23:52 +03:00
Dmitry Stogov
098b1f89bd Update IR (#20916)
IR commit: 40cd6ad28c376cf006c360f39d8aeff6d6e7bf78
2026-01-12 21:23:38 +03:00
Dmitry Stogov
eb88c0a496 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR (#20710)
2025-12-15 20:13:40 +03:00
Dmitry Stogov
800c35027e Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR (#20710)
2025-12-15 20:13:24 +03:00
Dmitry Stogov
886729454f Update IR (#20710)
IR commit: 3d72a7295c77743da22b36bab808ebb5f564488d
2025-12-15 20:13:03 +03:00
Arnaud Le Blanc
626f3c3c7c Unify arg info representation for internal and user functions
The arg_info member of zend_function is now always a zend_arg_info*. Before,
it was a zend_internal_arg_info* on internal functions, unless the
ZEND_ACC_USER_ARG_INFO flag was set.

Closes GH-19022
2025-12-15 16:50:49 +01:00
Dmitry Stogov
f9a782d7a4 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR
2025-10-14 23:22:21 +03:00
Dmitry Stogov
c31c697a85 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR
2025-10-14 23:22:14 +03:00
Dmitry Stogov
191430dc3d Update IR
IR commit: 5a81104e650ebd7ac24eb63d4dff67db723a5278
2025-10-14 23:21:49 +03:00
Arnaud Le Blanc
dc8b9f05cd Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix JIT TLS on MacOS
2025-10-13 16:35:59 +02:00
Arnaud Le Blanc
0f634077aa Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Fix JIT TLS on MacOS
2025-10-13 16:31:14 +02:00
Arnaud Le Blanc
54d793dc41 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix JIT TLS on MacOS
2025-10-13 16:26:03 +02:00
Arnaud Le Blanc
3abebf3e31 Fix JIT TLS on MacOS
The dynamic loader, starting around version 1284, patches the thunk emitted for
thread local variables by the compiler, so that its format changes from

struct Thunk {
    void *func;
    size_t module;
    size_t offset;
}

to

struct Thunk_v2 {
     void *func;
     uint32_t module;
     uint32_t offset;
     // other fields
}

which has the same size, but not the same layout.

This is mentionned in
9307719dd8/libdyld/ThreadLocalVariables.h (L90)

As a result, access to thread specific variables in JIT is broken.

Fix by using the new layout when the new dynamic loader is in use.

Closes GH-20121
2025-10-13 16:16:39 +02:00
Dmitry Stogov
4b2bb20731 Merge branch 'PHP-8.5'
* PHP-8.5:
  Update IR
2025-10-08 23:37:26 +03:00
Dmitry Stogov
f77be081e1 Merge branch 'PHP-8.4' into PHP-8.5
* PHP-8.4:
  Update IR
2025-10-08 23:37:16 +03:00
Dmitry Stogov
dd4189da83 Update IR
IR commit: 62d48607eb3ae5a9d1240115e9e4bdb3decdcadf
2025-10-08 23:36:58 +03:00
Arnaud Le Blanc
5c0a1ef7c7 Merge branch 'PHP-8.5'
* PHP-8.5:
  Fix race condition in zend_runtime_jit(), zend_jit_hot_func()
2025-10-07 10:54:05 +02:00