History log of /PHP-8.2/Zend/Optimizer/block_pass.c (Results 1 – 23 of 23)
Revision Date Author Comments
# 631bc816 06-Feb-2024 Ilija Tovilo

Implement stackless internal function calls

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

Closes GH-12461


# 0b1d750d 11-Aug-2022 Ilija Tovilo

Allow arbitrary expressions in static variable initializer

Closes GH-9301


# 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 ...


# 19dfe05f 01-Nov-2023 Dmitry Stogov

Fixed inorrect QM_ASSIGN elimination

Fixes oss-fuzz #63771


# b5f8a727 31-Jul-2023 Dmitry Stogov

Fixed incorrect QM_ASSIGN elimination

Fixes OSS Fuzz #60895


# 9fc0eab4 24-Jul-2023 Dmitry Stogov

Fixed incorrect QM_ASSIGN elimination

Fixes OSS Fuzz #60735


# 5cad1a71 16-May-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix GH-11245 (In some specific cases SWITCH with one default statement will cause segfault)

The block optimizer pass allows the use of sources of the preceding
block if the block is a fo

Fix GH-11245 (In some specific cases SWITCH with one default statement will cause segfault)

The block optimizer pass allows the use of sources of the preceding
block if the block is a follower and not a target. This causes issues
when trying to remove FREE instructions: if the source is not in the
block of the FREE, then the FREE and source are still removed. Therefore
the other successor blocks, which must consume or FREE the temporary,
will still contain the FREE opline. This opline will now refer to a
temporary that doesn't exist anymore, which most of the time results in
a crash. For these kind of non-local scenarios, we'll let the SSA
based optimizations handle those cases.

Closes GH-11251.

show more ...


# 1f5d9534 27-Mar-2023 Dmitry Stogov

Fix incorrect optimization

Fixes oss-fuzz #57482


# dfe9c2af 15-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix incorrect comparison in block optimization pass

We're in the case of ZEND_JMPZ_EX or ZEND_JMPNZ_EX. The opcode gets
overwritten and only after the overwriting gets checked if we're i

Fix incorrect comparison in block optimization pass

We're in the case of ZEND_JMPZ_EX or ZEND_JMPNZ_EX. The opcode gets
overwritten and only after the overwriting gets checked if we're in a
JMPZ or JMPNZ case. This results in a wrong optimization.

Close GH-10329

show more ...


# 04645242 26-Dec-2022 Dmitry Stogov

Fix memory leak because of incorrect optimization

Fixes oss-fuzz #54488


# 770a544a 11-Mar-2022 Dmitry Stogov

Optimizer: Fix inorrect constant substitution in FETCH_LIST_R

Fixes oss-fuzz #45429


# 4543cd32 30-Dec-2021 Nikita Popov

Remove JMPZNZ opcode

While JMPZNZ can avoid execution of a separate JMP opcode in some
cases, it also prevents smart branch optimization, so creating
JMPZNZ may actually have a negat

Remove JMPZNZ opcode

While JMPZNZ can avoid execution of a separate JMP opcode in some
cases, it also prevents smart branch optimization, so creating
JMPZNZ may actually have a negative effect. It also adds additional
complexity for optimizations.

Drop JMPZNZ in favor of JMPZ+JMP or JMPNZ+JMP.

Closes GH-7857.

show more ...


# 0698bf79 30-Dec-2021 Nikita Popov

Add helper for convertion to CHECK_VAR/FREE/NOP

This is a recurring pattern whenever an instruction with an
operand is deleted.


# f455894b 06-Oct-2021 Nikita Popov

Don't start new block after loop free

This reverts the change from 493c91c7429ee4552d2b80a2648271e2ba97f15c.
Starting a new block means that in the common case where the loop var
fre

Don't start new block after loop free

This reverts the change from 493c91c7429ee4552d2b80a2648271e2ba97f15c.
Starting a new block means that in the common case where the loop var
free is not unreachable, we'll always merge back the block.

Instead fix the original problem by explicitly removing instructions
apart from the loop var free in block pass.

show more ...


# c19977d0 27-Sep-2021 Nikita Popov

Fix delayed early binding with optimization

It's possible for delayed early binding opcodes to get optimized
away if they are "unreachable". However, we still need to attempt
early b

Fix delayed early binding with optimization

It's possible for delayed early binding opcodes to get optimized
away if they are "unreachable". However, we still need to attempt
early binding for them. (In some cases we also corrupt the early
binding list outright during optimization, which is how I got here.)

Fix this by storing information about delayed early binding
independently of DECLARE_CLASS_DELAYED opcodes, so early binding is
performed even after the opcode has been dropped.

show more ...


# 50378666 20-Sep-2021 George Peter Banyard

Voidify zend_build_cfg()

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


# b97a0800 21-May-2021 Nikita Popov

Remove special UNREACHABLE_FREE handling in block pass

This results in an assertion failure when running under -e,
because there is an additional EXT_STMT + NOP before the FREE.
I do

Remove special UNREACHABLE_FREE handling in block pass

This results in an assertion failure when running under -e,
because there is an additional EXT_STMT + NOP before the FREE.
I don't think there's a strong reason to handle UNREACHABLE_FREE
specially here (it's only important that we *do* handle it), so
I'm dropping the code rather than adjusting it to scan over
certain opcodes.

show more ...


# 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 ...


# b82242a8 20-Apr-2021 Nikita Popov

Remove unnecessary php.h includes from Zend/

The Zend/ directory really shouldn't be including php headers.
These particular includes are plain unnecessary.


# 462da6e0 31-Mar-2021 Josh Soref

Fix spelling and grammar mistakes

This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

Fix spelling and grammar mistakes

This PR corrects misspellings identified by the check-spelling action.

The misspellings have been reported at jsoref@b6ba3e2#commitcomment-48946465

The action reports that the changes in this PR would make it happy: jsoref@602417c

Closes GH-6822.

show more ...


# 5caaf40b 29-Sep-2020 George Peter Banyard

Introduce pseudo-keyword ZEND_FALLTHROUGH

And use it instead of comments


# 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 ...