History log of /php-src/Zend/Optimizer/zend_inference.c (Results 1 – 25 of 210)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 5f9b9c4e 15-Apr-2024 Dmitry Stogov

Fixed missed exception


# 00c6d538 01-Apr-2024 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

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 func

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

show more ...


# 56cf09f2 18-Mar-2024 Máté Kocsis

Improve optimizer support for class constants (#13438)

The following optimizations are added:

- Constant folding of final class constants
- Type inference of typed class constan

Improve optimizer support for class constants (#13438)

The following optimizations are added:

- Constant folding of final class constants
- Type inference of typed class constants

show more ...


# 97e6c543 06-Feb-2024 Ilija Tovilo

Fix RC inference narrowing for ASSIGN_OBJ

Fixes oss-fuzz #66519
Closes GH-13345


# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-12461


# f91833d2 05-Feb-2024 Ilija Tovilo

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.


# 79e8f20e 01-Feb-2024 Ilija Tovilo

Add type inference for various missing opcodes

Closes GH-13304


# 77bc863e 01-Feb-2024 Ilija Tovilo

Improve ZEND_FETCH_CLASS_STATIC static inference for final classes

Same as 95f7335.


# 668edf2c 24-Jan-2024 Ilija Tovilo

Improve ASSIGN_OBJ RC inference

ASSIGN_OBJ may only modify RC if it implements __set.

Closes GH-13237


# b06311cb 24-Jan-2024 Ilija Tovilo

Improve ZEND_NEW RC inference

ZEND_NEW returns RC1 if the instanciated class has no constructor.

Closes GH-13239


# 3a5edcca 29-Jan-2024 Ilija Tovilo

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 ch

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

show more ...


# 34e2dc56 29-Jan-2024 Ilija Tovilo

Improve is_instanceof inference (#13238)

When a class is final, it may be treated as !is_instanceof.


# 6f6289ca 23-Jan-2024 Ilija Tovilo

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, a

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

show more ...


# b33e3eb8 16-Jan-2024 Dmitry Stogov

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 exc

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)

show more ...


# 731734da 18-Dec-2023 Dmitry Stogov

Fixed type inference

Fixes oss-fuzz #65150


# 1e55c976 01-Dec-2023 Dmitry Stogov

Fixed type inference

Fixes oss-fuzz #64577, #64579, #64589


# 423a1e58 28-Nov-2023 Dmitry Stogov

Fixed GH-8251: Narrowing occurred during type inference of ZEND_FETCH_DIM_W


# 5a778704 08-Nov-2023 Dmitry Stogov

Fixed empty array inference


# cb1e8429 06-Nov-2023 Ilija Tovilo

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


# 1c95e227 02-Nov-2023 Dmitry Stogov

Fixed 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


# 798b9d09 02-Nov-2023 Dmitry Stogov

Fixed GH-10008: Narrowing occurred during type inference of ZEND_ADD_ARRAY_ELEMENT


# b3b46a44 31-Oct-2023 Dmitry Stogov

Fixed GH-12511: Use must be in next opline assertion with patched infection


# bd185c3d 26-Oct-2023 Dmitry Stogov

Implement iterative Pearce's SCC finding algoritm (#12528)

* Switch to Pearce's SCC algorithm

* Implement iterative Pearce's SCC algorithm

* Wrap "goto" with "#ifdef SYM_RA

Implement iterative Pearce's SCC finding algoritm (#12528)

* Switch to Pearce's SCC algorithm

* Implement iterative Pearce's SCC algorithm

* Wrap "goto" with "#ifdef SYM_RANGE"

show more ...


# 5f46d869 26-Oct-2023 Dmitry Stogov

Fixed GH-12509: JIT assertion when running php-parser tests


# ce269178 26-Oct-2023 Dmitry Stogov

Fixed code generation for DETCH_DIM_R

Fixes oss-fuzz #63613 and #63619


123456789