Commit graph

175 commits

Author SHA1 Message Date
Dmitry Stogov
ea37abd412 Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix type inference
2023-01-30 13:16:17 +03:00
Dmitry Stogov
55e3f73109 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix type inference
2023-01-30 13:16:05 +03:00
Dmitry Stogov
81607a62ca Fix type inference
Fixes oss-fuzz #55358
2023-01-30 13:15:05 +03:00
Dmitry Stogov
e335630d8b Merge branch 'PHP-8.2'
* PHP-8.2:
  Fix incorrect check condition in type inference (#10425)
2023-01-24 09:32:38 +03:00
Dmitry Stogov
227b3b3281 Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix incorrect check condition in type inference (#10425)
2023-01-24 09:32:26 +03:00
Niels Dossche
2787e3cd65
Fix incorrect check condition in type inference (#10425)
The "nothing to do" case would never be hit because the switch block
would execute if the opcode is ZEND_ASSIGN_STATIC_PROP_OP,
not ZEND_ASSIGN_STATIC_PROP. This meant that we were falling through to
the else block. Fix this by correcting the check condition.
2023-01-24 09:32:07 +03:00
Christoph M. Becker
2f4973fd88
Revert GH-10279
Cf. <https://github.com/php/php-src/pull/10220#issuecomment-1383739816>.

This reverts commit 45a128c9de.
This reverts commit 1eb71c3f15.
This reverts commit 492523a779.
This reverts commit c7a4633891.
This reverts commit 308adb915c.
This reverts commit cd27d5e07f.
This reverts commit c5933409b4.
This reverts commit 46371f4eb3.
This reverts commit 623e2e9fc6.
This reverts commit e7434c1247.
This reverts commit d28d323ca2.
This reverts commit 1a067b84ee.
This reverts commit a55c0c5fc3.
This reverts commit b5aeb3a4d4.
This reverts commit f061a035e4.
This reverts commit b088575119.
This reverts commit b1d48774a7.
This reverts commit 94f9a20ce6.
This reverts commit 4831e48708.
This reverts commit cd985de190.
This reverts commit 9521d21681.
This reverts commit d6136151e9.
2023-01-16 12:25:59 +01:00
Max Kellermann
492523a779 Zend/zend_inference: include cleanup 2023-01-12 15:12:45 +00:00
Max Kellermann
efd5ecb0f2 Zend/Optimizer/zend_inference: make several pointers const
This allows removing several deconst casts from the JIT.
2023-01-04 12:59:16 +00:00
Dmitry Stogov
94b8c2da9f Fixed type inference
Fixes oss-fuzz #51640
2022-09-26 12:19:12 +03:00
Dmitry Stogov
7496a400aa Fix SSA construction and type inference
Fixes oss-fuzz #51476
2022-09-19 15:45:34 +03:00
Dmitry Stogov
c151e9b75b Merge branch 'PHP-8.1' into PHP-8.2
* PHP-8.1:
  Fix type inference
2022-09-05 13:01:04 +03:00
Dmitry Stogov
c852e0fff9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference
2022-09-05 12:56:34 +03:00
Dmitry Stogov
567213c32a 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.
2022-08-23 11:22:31 +03:00
Dmitry Stogov
e10d2c2bf9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-08-22 21:12:49 +03:00
Dmitry Stogov
95befc786a Fix type inference
Fixes oss-fuzz #50272
2022-08-22 21:11:39 +03:00
Dmitry Stogov
87cf05e8be Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-07-25 15:55:15 +03:00
Dmitry Stogov
d50875c822 Fix type inference
Fixes oss-fuzz #49423 and #49474
2022-07-25 15:53:06 +03:00
Dmitry Stogov
71814e9d99 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-07-18 14:20:41 +03:00
Dmitry Stogov
82d3ad64df Fix type inference
Fixes oss-fuzz #48908
2022-07-18 14:20:06 +03:00
Dmitry Stogov
26d890e6ba Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference for FETCH_DI_UNSET
2022-07-18 13:15:12 +03:00
Dmitry Stogov
b734d45626 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference for FETCH_DI_UNSET
2022-07-18 13:15:03 +03:00
Dmitry Stogov
20a902749a Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-06-14 12:00:26 +03:00
Dmitry Stogov
729be469ae Fix type inference
This dixes oss-fuzz #47921
2022-06-14 11:59:35 +03:00
Dmitry Stogov
f56371bdd3 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-06-14 10:21:24 +03:00
Dmitry Stogov
1b45efb6fb Fix type inference
This fixes oss-fuzz #47920
2022-06-14 10:20:45 +03:00
Ilija Tovilo
5a855ee8d6
Fix GH-8661: Nullsafe in coalesce triggers undefined variable warning
Closes GH-8690
2022-06-12 21:52:14 +02:00
George Peter Banyard
b40ae80804
Convert iterable into an internal alias for Traversable|array (#7309)
This does a compile time transformation of ``iterable`` into ``Traversable|array`` which simplifies some of the LSP variance handling.

The arginfo generation script from stubs is updated to produce a union type when it encounters the type ``iterable``
Extension functions which do not regenerate the arginfo, or write them manually are still supported by mimicking the compile time transformation while registering the function.

Type Reflection is preserved for single ``iterable`` (and ``?iterable``) to produce a ReflectionNamedType with name ``iterable``, however usage of ``iterable`` in union types will be converted to ``array|Traversable``
2022-06-07 13:35:34 +01:00
Dmitry Stogov
faf3410957 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-06-06 11:14:33 +03:00
Dmitry Stogov
b86c6245cc Fix type inference
This fixes oss-fuzz #47777
2022-06-06 11:13:53 +03:00
Dmitry Stogov
adc8155119 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-05-16 12:42:14 +03:00
Dmitry Stogov
aad5fbac85 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference
2022-05-16 12:42:04 +03:00
Dmitry Stogov
89fa77516c Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-05-11 12:40:16 +03:00
Dmitry Stogov
84c1e99ecf Fix type inference
This fizes oss-fuzz #47044
2022-05-11 12:39:26 +03:00
Dmitry Stogov
2495459e50 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-05-11 12:10:00 +03:00
Dmitry Stogov
f1fc58ed8d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference
2022-05-11 12:09:53 +03:00
Dmitry Stogov
992c8061b4 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference
2022-04-25 12:17:17 +03:00
Dmitry Stogov
e14dc15e13 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference
2022-04-25 12:17:07 +03:00
Dmitry Stogov
9e6eb9d5a5 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type narrowing warning during type inference of ZEND_FETCH_DIM_W
2022-04-25 11:18:37 +03:00
Dmitry Stogov
2cff0e674d Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type narrowing warning during type inference of ZEND_FETCH_DIM_W
2022-04-25 11:17:04 +03:00
Nikita Popov
1254aa4f3e Avoid setting ce for ref return_info
This is unlikely to matter in practice (due to short lifetime),
but necessary to satisfy the SSA integrity check.

Fixes oss-fuzz #46980.
2022-04-24 17:35:51 +02:00
Nikita Popov
462dc9da6a Don't specify ce for MAY_BE_REF STATIC_PROP_FETCH
This is unlikely to matter in practice (due to the short lifetime),
but we should not specify a CE for a potential ref result.

Fixes oss-fuzz #46810.
2022-04-18 10:45:57 +02:00
Nikita Popov
df4c27642e Check opcode rather than result_type for R/IS type inference
We may sometimes create FETCH_*_R opcodes with VAR type (e.g. if a
FUNC_ARG opcode is converted to BP_VAR_R fetch kind). Make sure we
don't infer overly conservative types in that case.
2022-04-16 22:42:20 +02:00
Nikita Popov
4bd7f4e0ad Check that MAY_BE_REF variables cannot have a ce 2022-04-15 23:57:21 +02:00
Nikita Popov
7408da7ac0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2022-04-15 23:15:06 +02:00
Nikita Popov
4026daee2b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2022-04-15 23:14:59 +02:00
Nikita Popov
01996d1534 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't use CE for by-ref arguments
2022-04-15 23:01:05 +02:00
Nikita Popov
38547b996a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't use CE for by-ref arguments
2022-04-15 23:00:59 +02:00
Nikita Popov
bc24c62030 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't use CE info from pi node for MAY_BE_REF var
2022-04-15 22:39:13 +02:00
Nikita Popov
f1814e6a1f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't use CE info from pi node for MAY_BE_REF var
2022-04-15 22:37:29 +02:00