History log of /php-src/Zend/Optimizer/zend_inference.h (Results 1 – 19 of 19)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 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 ...


# 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


# 6f63d4b2 19-Apr-2023 Ilija Tovilo

Fix -Wenum-int-mismatch warnings on gcc 13

Closes GH-11103


# d5c649b3 23-Feb-2023 Max Kellermann

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleadi

zend_compiler, ...: use `uint8_t` instead of `zend_uchar` (#10621)

`zend_uchar` suggests that the value is an ASCII character, but here,
it's about very small integers. This is misleading, so let's use a
C99 integer instead.

On all architectures currently supported by PHP, `zend_uchar` and
`uint8_t` are identical. This change is only about code readability.

show more ...


# 2f4973fd 16-Jan-2023 Christoph M. Becker

Revert GH-10279

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 45a128c9de93bf60956102d85d15f1fe8913bb70.
This reverts commit 1eb71c

Revert GH-10279

Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 45a128c9de93bf60956102d85d15f1fe8913bb70.
This reverts commit 1eb71c3f155a42ad6867cd5e2f6d921a99506a37.
This reverts commit 492523a779dced91eb09215183287e0856b693bf.
This reverts commit c7a4633891392d16d40b08135598807b3f0443b0.
This reverts commit 308adb915c1b659ab377f752fb27b408a455d7ed.
This reverts commit cd27d5e07f01172ac8a701996d260a731489d856.
This reverts commit c5933409b47bea760977cf9c9ea04cbb63aaafe5.
This reverts commit 46371f4eb339f7e7615a8732d61f2369f8d9129e.
This reverts commit 623e2e9fc6a23b8eb7f22010eaf99bf6f638917d.
This reverts commit e7434c124772c05fe836832e02196d50bec10c23.
This reverts commit d28d323ca20976ed776171330b90588cc3857dd6.
This reverts commit 1a067b84ee423a6fb06a5debd92b4cafefeac4e4.
This reverts commit a55c0c5fc3f624a685f42281df26cf87f445be43.
This reverts commit b5aeb3a4d40dbf38da65975d12b9d2c593b83bdd.
This reverts commit f061a035e44d3f6bbc71774f2101525d74fbf16f.
This reverts commit b088575119b3244a4d08f6a300251111a221c66b.
This reverts commit b1d48774a79592e7fb1ba85d3a2bd6717f25acec.
This reverts commit 94f9a20ce6451b54e8346cc474de6b4f9b8897a4.
This reverts commit 4831e48708e19346ace0fa5f3f085ee8afd43267.
This reverts commit cd985de190534c8e3567a4c5547eb98c45337fa0.
This reverts commit 9521d21681b22a471f21b3c56e32b883acac3301.
This reverts commit d6136151e9f7fc40e753ac0ebe1790e0d0371b6b.

show more ...


# 492523a7 04-Jan-2023 Max Kellermann

Zend/zend_inference: include cleanup


# efd5ecb0 03-Jan-2023 Max Kellermann

Zend/Optimizer/zend_inference: make several pointers const

This allows removing several deconst casts from the JIT.


Revision tags: php-8.2.0RC1, php-8.1.10, php-8.0.23
# 567213c3 23-Aug-2022 Dmitry Stogov

Drop range inference for IS_NULL/IS_FALSE/IS_TRUE.

These values not always converted to IS_LONG (e.g. by -- and ++) and
this leads to incorrect range inferene and later to incorrect JIT

Drop range inference for IS_NULL/IS_FALSE/IS_TRUE.

These values not always converted to IS_LONG (e.g. by -- and ++) and
this leads to incorrect range inferene and later to incorrect JIT code
generation.

show more ...

Revision tags: php-8.0.23RC1, php-8.1.10RC1, php-8.2.0beta3, php-8.2.0beta2, php-8.1.9, php-8.0.22, php-8.1.9RC1, php-8.2.0beta1, php-8.0.22RC1, php-8.0.21, php-8.1.8, php-8.2.0alpha3, php-8.1.8RC1, php-8.2.0alpha2, php-8.0.21RC1, php-8.0.20, php-8.1.7, php-8.2.0alpha1, php-7.4.30, php-8.1.7RC1, php-8.0.20RC1, php-8.1.6, php-8.0.19, php-8.1.6RC1, php-8.0.19RC1, php-8.0.18, php-8.1.5, php-7.4.29, php-8.1.5RC1, php-8.0.18RC1, php-8.1.4, php-8.0.17, php-8.1.4RC1, php-8.0.17RC1, php-8.1.3, php-8.0.16, php-7.4.28, php-8.1.3RC1, php-8.0.16RC1, php-8.1.2, php-8.0.15, php-8.1.2RC1, php-8.0.15RC1, php-8.0.14, php-8.1.1, php-7.4.27, php-8.1.1RC1, php-8.0.14RC1, php-7.4.27RC1, php-8.1.0, php-8.0.13, php-7.4.26, php-7.3.33, php-8.1.0RC6, php-7.4.26RC1, php-8.0.13RC1, php-8.1.0RC5, php-7.3.32, php-7.4.25, php-8.0.12, php-8.1.0RC4, php-8.0.12RC1, php-7.4.25RC1, php-8.1.0RC3, php-8.0.11, php-7.4.24, php-7.3.31
# 6c928f35 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_find_false_dependencies()

It always returned SUCCESS

# ad3544b0 20-Sep-2021 George Peter Banyard

Voidify zend_ssa_find_sccs()

It always returned SUCCESS

# 53d5420d 20-Sep-2021 George Peter Banyard

Use more appropriate types in Optimizer

Mainly using zend_result and bool instead of int

Revision tags: php-8.1.0RC2
# 353461ae 13-Sep-2021 Dmitry Stogov

Separate zend_array_type_info() to avoid loop inlining

Revision tags: php-7.4.24RC1, php-8.0.11RC1, php-8.1.0RC1, php-7.4.23, php-8.0.10, php-7.3.30, php-8.1.0beta3
# 1ffbb737 13-Aug-2021 Dmitry Stogov

Better specialization for packed/hash arrays

- improved packed/hash inference.
- added hash guards for ASSIGN_DIM, ASSIGN_DIM_OP, FETCH_DIM_W* instructions
- more accurate invariant

Better specialization for packed/hash arrays

- improved packed/hash inference.
- added hash guards for ASSIGN_DIM, ASSIGN_DIM_OP, FETCH_DIM_W* instructions
- more accurate invariant type guards motion
- invariant packed/hash guards motion
- rename MAY_BE_ARRAY_HASH into MAY_BE_ARRAY_NUMERIC_HASH and add MAY_BE_ARRAY_STRING_HASH
- cleanup

show more ...

# aaa14501 11-Aug-2021 Dmitry Stogov

Make private functions "static" and remove unused zend_inference_check_recursive_dependencies().

Revision tags: php-8.0.10RC1, php-7.4.23RC1, php-8.1.0beta2, php-8.0.9, php-7.4.22, php-8.1.0beta1, php-7.4.22RC1, php-8.0.9RC1, php-8.1.0alpha3, php-7.4.21, php-7.3.29, php-8.0.8, php-8.1.0alpha2, php-7.4.21RC1, php-8.0.8RC1, php-8.1.0alpha1, php-8.0.7, php-7.4.20, php-8.0.7RC1, php-7.4.20RC1, php-8.0.6, php-7.4.19
# 7b85d3bb 28-Apr-2021 Nikita Popov

Add support for verifying optimizer func info

This is guarded by -DZEND_VERIFY_FUNC_INFO=1. Enable this on the
variation job.

Closes GH-6924.

# 532c60cb 06-May-2021 Máté Kocsis

Add support for tentative return types of internal methods

RFC: https://wiki.php.net/rfc/internal_method_return_types

Closses GH-6971

# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...

Revision tags: php-7.4.18, php-7.3.28, php-8.0.5, php-8.0.5RC1, php-7.4.18RC1
# 2d0e2733 18-Mar-2021 Nikita Popov

Support prototypes in call graph

Even if we don't know the exact method being called, include it
in the call graph with the is_prototype flag. In particular, we
can still make use of

Support prototypes in call graph

Even if we don't know the exact method being called, include it
in the call graph with the is_prototype flag. In particular, we
can still make use of return types from prototype methods, as
PHP 8 makes LSP violations a hard error.

Most other places are adjusted to skip calls with !is_prototype.
Maybe some of them would be fine, but ignoring them is conservative.

show more ...

Revision tags: php-8.0.4RC1, php-7.4.17RC1, php-8.0.3, php-7.4.16, php-8.0.3RC1, php-7.4.16RC1, php-8.0.2, php-7.4.15, php-7.3.27
# 83be073a 26-Jan-2021 Nikita Popov

Move optimizer into core

This only moves the files, adjusts the build system, exports APIs
and does minor fixups to make sure the code builds.

This does not yet try to make the

Move optimizer into core

This only moves the files, adjusts the build system, exports APIs
and does minor fixups to make sure the code builds.

This does not yet try to make the optimizer usable independently
of opcache.

Closes GH-6642.

show more ...