1
0
mirror of https://github.com/php/php-src.git synced 2026-04-07 08:02:49 +02:00
Commit Graph

1727 Commits

Author SHA1 Message Date
Dmitry Stogov
81cb005ef7 Fix type inference
Fixes oss-fuzz #50792
2022-09-05 12:55:50 +03:00
Dmitry Stogov
4135e6011c Fix memory leak
Fixes oss-fuzz #50616
2022-08-29 14:53:48 +03:00
Dmitry Stogov
af1a7b7b72 Fix SSA reconstruction when body of "foreach" loop is removed
Fixes oss-fuzz #49483
2022-08-01 14:00:19 +03:00
Dmitry Stogov
bd30eff5de Fix type inference for FETCH_DI_UNSET
Fixes oss-fuzz #48507
2022-07-18 13:14:15 +03:00
Dmitry Stogov
229e80c6ef Fix memory leak
This fixes oss-fuzz #48051
2022-06-20 10:59:37 +03:00
Dmitry Stogov
84ea0aa684 Fix memory leak
This fixes oss-fuzz #47448
2022-05-16 13:45:31 +03:00
Dmitry Stogov
05375602a7 Fix type inference
This fixes oss-fuzz #47422
2022-05-16 12:41:25 +03:00
Arnaud Le Blanc
33b8ef9958 Do not optimize out ini_get() when the entry does not exist during compilation (#8507)
The entry may exist later if dl is enabled

Fixes GH-8466
2022-05-13 12:39:29 +02:00
Dmitry Stogov
3f1e1b9ddf Fix type inference
This fixes oss-fuzz #47049
2022-05-11 12:09:11 +03:00
Dmitry Stogov
3b735456c6 Reorder optimization passes to avoid miss-optimization 2022-04-25 13:09:05 +03:00
Dmitry Stogov
3e78964742 Fix type inference
Use MAY_BE_NULL result (insted of empty) for ASSIGN_DIM with invalid arguments
This fixes oss-fuzz #46840
2022-04-25 12:15:55 +03:00
Dmitry Stogov
8286de2fd3 Fix type narrowing warning during type inference of ZEND_FETCH_DIM_W
Fixes oss-fuzz #45820
2022-04-25 11:16:10 +03:00
Nikita Popov
d16d251e20 Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
ZEND_ASSIGN is not the only place where this is relevant, so
handle it generically inside COPY_SSA_OBJ_TYPE instead.
2022-04-15 23:14:04 +02:00
Nikita Popov
5d072578cd Don't use CE for by-ref arguments 2022-04-15 23:00:43 +02:00
Nikita Popov
41f33b9dc3 Don't use CE info from pi node for MAY_BE_REF var
Once again, the actual class type may be reassigned indirectly.
2022-04-15 22:36:13 +02:00
Nikita Popov
b08aac0451 Fix inference for assignment of known object to reference
We cannot retain the ce information in that case, we have to
assume the ce may change indirectly through the reference.

Fixes oss-fuzz #46720.
2022-04-15 22:14:44 +02:00
Dmitry Stogov
c0bb238483 Fixed reference counting inference
Fixes oss-fuzz #46084
2022-04-04 15:34:02 +03:00
Dmitry Stogov
2b7431cf5b Fix memory leak
Fixed oss-fuzz #45535
2022-03-14 12:57:37 +03:00
Dmitry Stogov
151d2ac5ae Fixed memory leak
Fixes oss-fuzz #45191
2022-03-11 11:32:23 +03:00
Dmitry Stogov
78c7289f69 Fixed incorrect DCE for FREE
Fixes oss-fuzz #44863
2022-02-28 11:44:22 +03:00
Christoph M. Becker
ef80dcb80b Fix GH-8074: Wrong type inference of range() result
If either the first or second operand of `range()` may be a string, we
must not exclude the possibility that the result may be an array of
longs.

Closes GH-8131.
2022-02-22 10:14:54 +01:00
Dmitry Stogov
7434909dc6 Fix type inference
Fixes oss-fuzz #44407
2022-02-11 13:03:36 +03:00
Dmitry Stogov
965dafe3e1 Fix too aggressive DCE that leads to memory leak
Fixes oss-fuzz #43738
2022-01-28 12:17:46 +03:00
Dmitry Stogov
1f58365438 Fix type inference
Fixes oss-fuzz #43367
2022-01-10 21:53:35 +03:00
Dmitry Stogov
698ac23711 Fixed NAN handling in SCCP
Fixes oss-fuzz #43341
2022-01-10 19:39:19 +03:00
Dmitry Stogov
b80d30d821 Fix type inference for assign to string offset with invalid index.
Fixes oss-fuzz #43277
2022-01-10 16:03:54 +03:00
Dmitry Stogov
de358f856f Fix reference contig inference
Fixes oss-fuzz #43032
2021-12-28 09:57:03 +03:00
Dmitry Stogov
2b81156f2a Fix memory leak in SCCP
Fixes oss-fuzz #42878
2021-12-24 13:10:22 +03:00
Dmitry Stogov
e004e844f7 Fix incorrect optimization of ASSIGN_OP that may lead to memory leak
Fixes oss-fuzz #42506
2021-12-20 15:06:32 +03:00
Dmitry Stogov
f18bb2477f Fix type inference for INIT_ARRAY with invalid index
Fixes oss-fuzz #42568
2021-12-20 11:40:11 +03:00
Dmitry Stogov
230de7721f Fix incorrect optimization that leads to memory leak
Fixes oss-fuzz #42221
2021-12-13 13:08:05 +03:00
Christoph M. Becker
0b3a937670 Fix GH-7759: Incorrect return types for hash() and hash_hmac()
`hash()` and `hash_hmac()` never return `false`; only `hash_file()` and
`hash_hmac_file()` return `false` in case the data cannot be read.

Closes GH-7760.
2021-12-12 15:39:55 +01:00
Dmitry Stogov
6f42c073cf Remove range inference for booleans.
Range inference for bolleans and longs comparison was incorrect.

Fizes oss-fuzz #fuzz-42161.php
2021-12-10 14:32:47 +03:00
Dmitry Stogov
0ac3d78d7d Fix incorrect JMP optimization
Fixes oss-fuzz #42155
2021-12-10 01:39:28 +03:00
Dmitry Stogov
7b629afe4e Fixed incorrect DCE of a constructor call
Fixez oss-fuzz #42049
2021-12-06 15:59:30 +03:00
Dmitry Stogov
aa7280264e Fix refcount inferemce ($a += $a returns old array with RCN)
Fixes oss-fuzz #41670
2021-12-06 11:30:03 +03:00
Dmitry Stogov
c1036194d6 JIT: Fix incorrect reference counting inference
Fixes oss-fuzz #40747
2021-11-30 12:58:54 +03:00
Dmitry Stogov
86430e8e01 Fixed type inference (it's safe to ignore reference counting narrowing) 2021-11-29 23:32:52 +03:00
Dmitry Stogov
aff115547f JIT: Fix exception handling when next array element is already occupied
Fixes oss-fuzz #41408
2021-11-29 21:44:00 +03:00
Dmitry Stogov
297117bbc5 Disable type narrowing optimization when we contruct SSA for JIT
This also revets incorrect fix introduced in f9518c3850
2021-11-29 15:51:54 +03:00
Dmitry Stogov
f9518c3850 Fixed incorrect narrowing to double
Fixes oss-fuzz #41223
2021-11-25 15:14:04 +03:00
Dmitry Stogov
3c53a9fd73 Fixed incorrect refcountion inference for BW_NOT
BW_NOT for emtpy string returns empty string

Fixes oss-fuzz #41280
2021-11-25 13:51:56 +03:00
Dmitry Stogov
f302430c72 Fixed incorrect DCE for ADD_ARRAY_ELEMENT instruction
DCE might remove INIT_ARRAY instruction but then keep the related
ADD_ARRAY_ELEMENT, becuse its both operands need to be freed.

Fixes oss-fuzz #41309
2021-11-25 13:33:26 +03:00
Nikita Popov
be271f277e Fix bug #81652
We need to check not only for defs but also for uses of the
variable.
2021-11-24 15:18:31 +01:00
Dmitry Stogov
292d76d8a4 JIT: Fixed reference-counting inference 2021-11-15 10:39:58 +03:00
Dmitry Stogov
535a0553e8 Fixed incorrect reference counter inference 2021-11-08 20:54:17 +03:00
Nikita Popov
53df29bc29 Drop pi nodes for both old/new pred in replace_predecessor
We also need to drop pi nodes for new_pred here, as the pi node
restriction for new_pred is not necessarily true for control
coming from old_pred as well.

Fixes oss-fuzz #40782.
2021-11-08 14:56:42 +01:00
Dmitry Stogov
66d93c63ff Fixed type inference for FETCH_DIM_W without use 2021-11-03 19:44:38 +03:00
Dmitry Stogov
5c43e0c0ee Fixed incorrect assumption about reference counting 2021-11-01 20:28:05 +03:00
Nikita Popov
2e29817005 Handle FETCH_DIM_R after FETCH_DIM_FUNC_ARG in inference
This can happen if a call is optimized, but FETCH_DIM_FUNC_ARG
cannot be converted to FETCH_DIM_R because it uses an UNUSED op2,
which is not supported by FETCH_DIM_R.

Fixes oss-fuzz 6144185837682688.
2021-11-01 14:26:36 +01:00