Commit Graph

122939 Commits

Author SHA1 Message Date
Nikita Popov
8c4a7f20f5 Fix COPY_TMP live range construction with optimization
The use may be optimized away, leaving us only with the free use.
Also fix off-by-one error in the other optimization case.
2021-11-11 10:35:34 +01:00
Dmitry Stogov
64915775a7 JIT: Fixed incorrect MOD into BW_AND optimization 2021-11-10 21:14:41 +03:00
Dmitry Stogov
3081423706 Tracing JIT: Fixed register allocation
In case of side exit on ADD/SUB/MUL overflow source registers must be kept unchanged
2021-11-10 20:04:25 +03:00
Dmitry Stogov
3dba5566ce Tracing JIT: Fixed incorrect assumption about in-memeory zval type 2021-11-10 16:46:09 +03:00
Dmitry Stogov
45683703f1 JIT: Fixed memory leak 2021-11-10 12:49:20 +03:00
Petar Obradović
87069d3dcc Fix invalid mbstring config reference
Closes GH-7637.

[ci skip]
2021-11-10 09:44:56 +01:00
Dmitry Stogov
203c1b807e Tracing JIT: Fixed incorrect tracing type inference
There are some cases when IS_VAR/IS_TMP_VAR variables are set to IS_UNDEF.
TODO: It would be better to switch to IS_NULL in master.
2021-11-10 11:10:44 +03:00
Nikita Popov
a551b08307 Add string return type to __toString() of internal classes
Same as with userland classes, automatically add a string return
type to __toString() methods in internal classes, so the signature
is compatible with Stringable.
2021-11-09 10:17:26 +01:00
Dmitry Stogov
535a0553e8 Fixed incorrect reference counter inference 2021-11-08 20:54:17 +03:00
Dmitry Stogov
8fe808207f JIT: Fixed incorrect guard elimination 2021-11-08 20:08:39 +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
e868ded6ef Don't call _zend_hash_index_find() for packed arrays 2021-11-08 13:13:23 +03:00
Dmitry Stogov
7bf63243e1 JIT: Fixed incorrect guard elimination 2021-11-08 12:28:36 +03:00
Nikita Popov
9b2a3c1c4f Fix stubs for bzerr* functions
These can return false if the stream is not a bz2 stream. Also
emit a warning in this case, this should not be failing silently.
2021-11-05 11:09:20 +01:00
Nikita Popov
b302bfabe7 Implement Stringable automatically for internal classes
Requiring all internal classes (including those from 3rd-party
extensions) to implement Stringable if they provide __toString()
is too error prone. Case in point, our _ZendTestClass test class
was not doing so, resulting in preloading test failures after
recent changes.

Instead we automatically implement Stringable, the same as we do
for userland classes. We still allow explicit implementations,
but ignore them (normally they would result in an error due to
duplicate interface implementation). Finally, we need to be
careful about not trying to implement Stringable on Stringable
itself.

In some cases this changes the interface order, in particular the
automatic Stringable implementation will now come first.
2021-11-05 10:22:04 +01:00
Nikita Popov
d478ae73b1 Don't implement Stringable on traits
Traits do not support interfaces, so we should not implement
Stringable on them.

Also check the __toString() return type in the same way other
magic methods do, otherwise we would now miss the check in the
trait case.
2021-11-05 09:42:58 +01:00
Nikita Popov
7e67366a9b Remove unnecessary assertion
zend_class_implements_interface works fine if the "class" is an
interface, so simply drop this assertion. This avoids the need to
special case this situation.
2021-11-04 17:00:17 +01:00
Nikita Popov
4c171ed5eb Fix bug #81591: ignore_repeated_errors broken
We should suppress the error if the message is the same, not if
it's different. Apparently we had no test coverage for these
options.
2021-11-04 16:23:55 +01:00
Nikita Popov
462271c7e0 Fix typo
[ci skip]
2021-11-04 15:05:43 +01:00
Nikita Popov
ee37774466 Suppress unused label warnings in SWITCH VM
While we avoid emitting labels for handlers that are not referenced
from anywhere else, we do not perform a fine-grained analysis on
used specializations, so some of the specialization labels may not
be used. Use ATTRIBUTE_UNUSED_LABEL to suppress the warning. Drop
"cold" from the definition of this attribute, as it is completely
unrelated.
2021-11-04 14:50:54 +01:00
Nikita Popov
d3932682e7 Fixed bug #81582
If __toString() comes from a trait, implement Stringable during
inheritance.
2021-11-04 11:58:33 +01:00
Christoph M. Becker
f22f4afd84
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #71316: libpng warning from imagecreatefromstring
2021-11-04 11:19:24 +01:00
Christoph M. Becker
1919c4b44d
Fix #71316: libpng warning from imagecreatefromstring
We backport the respective upstream fix[1] to our bundled libgd.

[1] <636100b928>

Closes GH-7615.
2021-11-04 11:16:45 +01:00
Nikita Popov
4b9fbc6627 Fixed bug #81587
iterator_funcs_ptr may be null for Iterators with custom
get_iterator. Ideally MultipleIterator would make use of get_iterator,
but this would require a large implementation change.
2021-11-04 10:34:52 +01:00
Dmitry Stogov
34d22acc7e Tracing JIT: Fixed incorrect guard elimination 2021-11-03 23:37:00 +03:00
Dmitry Stogov
66d93c63ff Fixed type inference for FETCH_DIM_W without use 2021-11-03 19:44:38 +03:00
Derick Rethans
5751536dec Merge branch 'PHP-7.4' into PHP-8.0 2021-11-03 16:13:35 +00:00
Derick Rethans
905a1d5011 Merge branch 'PHP-7.3' into PHP-7.4 2021-11-03 16:13:22 +00:00
Derick Rethans
88f99c9c1d Revert "Updated to version 2021.5 (2021e)"
This reverts commit a93ff1df20.
2021-11-03 16:13:05 +00:00
Derick Rethans
4ec9d07cc3 Updated to version 2021.5 (2021e) 2021-11-03 15:49:25 +00:00
Derick Rethans
b085f79cce Empty merge 2021-11-03 15:49:25 +00:00
Derick Rethans
7c9c722b53 Updated to version 2021.5 (2021e) 2021-11-03 15:49:24 +00:00
Derick Rethans
5715a5e570 Empty merge 2021-11-03 15:49:24 +00:00
Derick Rethans
a93ff1df20 Updated to version 2021.5 (2021e) 2021-11-03 15:49:23 +00:00
George Peter Banyard
84524afb9e
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix Bug #81588 TokyoCabinet driver leaks memory
2021-11-03 15:01:41 +00:00
George Peter Banyard
96dd310c54
Fix Bug #81588 TokyoCabinet driver leaks memory 2021-11-03 14:57:47 +00:00
Nikita Popov
546e55864d Fix WeakReference uniquing is TAG_HT is used 2021-11-03 10:06:22 +01:00
Derick Rethans
c5da497210 Merge branch 'PHP-7.4' into PHP-8.0 2021-11-02 16:39:55 +00:00
Derick Rethans
05b212bb3d Prepare for 7.4.27 2021-11-02 16:39:44 +00:00
Sara Golemon
2d4bfcfd3b
Prep for 8.0.14 2021-11-02 15:55:12 +00:00
Nikita Popov
a6d14f1143 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
  Accommodate changes to canonicalized forms in ICU >= 70.1
  Change UBool to bool for equality operators in ICU >= 70.1
2021-11-02 16:15:25 +01:00
Ben Ramsey
c7a2441e93 CLDR 40a0 uses a lowercase "temp" instead of "Temp" in ICU >= 70.1
Refer to:
49dda34fb1
2021-11-02 16:15:19 +01:00
Ben Ramsey
52cda6fc43 Accommodate changes to canonicalized forms in ICU >= 70.1
Refer to:
01e1adc9e4
2021-11-02 16:11:29 +01:00
Ben Ramsey
81b3f95622 Change UBool to bool for equality operators in ICU >= 70.1
Refer to:
- 633438f8da
- f6325d49ba
2021-11-02 16:07:51 +01:00
Dmitry Stogov
2605911272 Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element (test) 2021-11-01 22:19:10 +03:00
Dmitry Stogov
d7ac39b02d Tracing JIT: Fixed reference counting when escape because of IS_UNDEF element 2021-11-01 22:14:12 +03:00
Dmitry Stogov
5c43e0c0ee Fixed incorrect assumption about reference counting 2021-11-01 20:28:05 +03:00
Dmitry Stogov
f1e6a7d83d JIT: Fixed numeric string index handling 2021-11-01 18:50:32 +03:00
Dmitry Stogov
cd32b47235 JIT: Fixed register allocation in case of integer overflow 2021-11-01 16:46:41 +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