Tim Düsterhus
b43a7ac0e7
Zend: Make EG(fake_scope)
a const zend_class_entry*
( #19060 )
2025-07-09 11:55:53 +02:00
Dmitry Stogov
6666cc83c5
Fix RC inference of op1 of FETCH_OBJ and INIT_METHOD_CALL
...
Fixes GH-17151
Closes GH-17152
2024-12-18 19:08:51 +01:00
Dmitry Stogov
cfd954f5f9
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-16499: [JIT] Undefined to null coercion issues for return
2024-10-21 14:51:41 +03: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
Dmitry Stogov
7c8b3b2c96
Fix GH-15821: Core dumped in Zend/Optimizer/zend_inference.c:4062
2024-09-10 16:14:03 +03:00
Niels Dossche
f56a659293
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix GH-15661: Access null pointer in Zend/Optimizer/zend_inference.c
2024-09-09 20:12:07 +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
Ilija Tovilo
a0a8624346
Fix throw in IS_IDENTICAL in JIT ( #15103 )
...
We need to persist opline in case zend_is_identical() throws.
2024-07-25 13:18:47 +02:00
Cristian Rodríguez
8e62e2b829
Mark multple functions as static ( #13864 )
...
* Mark many functions as static
Multiple functions are missing the static qualifier.
* remove unused struct sigactions
struct sigaction act, old_term, old_quit, old_int;
all unused.
* optimizer: minXOR and maxXOR are unused
2024-05-22 13:11:46 +02:00
Ilija Tovilo
c2456e97f5
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fixed missed exception
2024-04-15 17:44:10 +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
Niels Dossche
00c6d538ab
Fix GH-13834: Applying non-zero offset 36 to null pointer in zend_jit.c ( #13846 )
...
* Fix GH-13834: Applying non-zero offset 36 to null pointer in zend_jit.c
ssa_op can be NULL in function JIT. Doing pointer arithmetic on a NULL
pointer is undefined behaviour. Undefined behaviour can be dangerous
because the optimizer may assume then that the variable is not actually
NULL.
To solve this:
1. Add ADVANCE_SSA_OP() to safely add an offset to ssa_op in zend_jit.c
2. For inference, add an extra offset argument to the helper functions.
To reproduce this, use Clang (not GCC) on a test like
sapi/cli/tests/gh12363.phpt (or other tests also work).
* Remove -fno-sanitize=pointer-overflow flag from CI
* Fix NULL pointer offsets added to the stack_map
* Fix an offset add on a potentially NULL ssa->ops
* Fix NULL pointer arithmetic in zend_range_info()
* Address review comments
2024-04-01 13:37:15 +02:00
Máté Kocsis
56cf09f23a
Improve optimizer support for class constants ( #13438 )
...
The following optimizations are added:
- Constant folding of final class constants
- Type inference of typed class constants
2024-03-18 07:30:44 +01:00
Ilija Tovilo
97e6c54336
Fix RC inference narrowing for ASSIGN_OBJ
...
Fixes oss-fuzz #66519
Closes GH-13345
2024-02-07 13:03:14 +01:00
Ilija Tovilo
631bc81607
Implement stackless internal function calls
...
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
Closes GH-12461
2024-02-06 17:42:28 +01:00
Ilija Tovilo
f91833d297
Fix RC inference for DECLARE_LAMBDA_FUNCTION
...
It doesn't seem like the VM can return RCn. However, the JIT fails without it.
I'll need to look into this more closely.
2024-02-05 12:19:18 +01:00
Ilija Tovilo
79e8f20e56
Add type inference for various missing opcodes
...
Closes GH-13304
2024-02-05 11:48:48 +01:00
Ilija Tovilo
77bc863e50
Improve ZEND_FETCH_CLASS_STATIC static inference for final classes
...
Same as 95f7335
.
2024-02-01 15:56:39 +01:00
Ilija Tovilo
668edf2cae
Improve ASSIGN_OBJ RC inference
...
ASSIGN_OBJ may only modify RC if it implements __set.
Closes GH-13237
2024-01-31 23:24:12 +01:00
Ilija Tovilo
b06311cb3d
Improve ZEND_NEW RC inference
...
ZEND_NEW returns RC1 if the instanciated class has no constructor.
Closes GH-13239
2024-01-30 16:31:29 +01:00
Ilija Tovilo
8d082958fe
Merge branch 'PHP-8.3'
...
* PHP-8.3:
Fix create_object checks
2024-01-30 16:14:08 +01: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
34e2dc5697
Improve is_instanceof inference ( #13238 )
...
When a class is final, it may be treated as !is_instanceof.
2024-01-29 12:48:55 +01:00
Ilija Tovilo
6f6289caca
Avoid new SSA var for ASSIGN_OBJ_REF without RC inference
...
Previously, this variable was necessary because of auto-vivification on
UNDEF/null/false. It's now only used for RC inference, as auto-vivification has
been removed.
This implicitly solves an inference problem for $obj->bar &= $obj; where we get
a new variable for both literal references to $obj, with the first one getting
the RCn flag, and the second one getting the MAY_BE_REFERENCE flag. Thus, the
first variable will be missing the reference type, causing a false-positive type
inference warning.
If we want to verify RC inference at some point we'll need a better solution.
Closes GH-13233
2024-01-24 11:30:49 +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
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
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
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
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