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

122973 Commits

Author SHA1 Message Date
Nikita Popov e81ad637f4 Update reflection test after stub change 2021-11-18 11:16:13 +01:00
Nikita Popov bc6ec0a109 Clarify that preg_match_all() cannot return null 2021-11-18 10:36:35 +01:00
Dmitry Stogov 9dd3e8be8a JIT: Fixed memory leak in Zend/tests/concat_002.phpt introduced by fac78ee760 2021-11-17 18:43:39 +03:00
Nikita Popov 4d4fe7639f Fixed bug #81631
We need to save the opline before fetching the operand, as it may
throw an undef var warning.
2021-11-17 16:06:25 +01:00
Dmitry Stogov fac78ee760 JIT: Fixed memory leak 2021-11-17 13:59:35 +03:00
Dmitry Stogov 48a65fef6f JIT: Fixed memory lieak 2021-11-17 12:48:56 +03:00
David Carlier fb3e646f6b OpenBSD ZTS build fix
Closes GH-7661.
2021-11-17 10:20:05 +01:00
Christoph M. Becker 8689248a56 [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  7.3.34 might be next
2021-11-16 13:29:23 +01:00
Christoph M. Becker be1cb5a13a [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  7.3.34 might be next
2021-11-16 13:26:05 +01:00
Christoph M. Becker 7d92153182 7.3.34 might be next 2021-11-16 13:24:00 +01:00
Christoph M. Becker b963208640 [ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:13:54 +01:00
Christoph M. Becker 8a2076475e [ci skip] Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Fix news entry for bug #79971
  [ci skip] Update NEWS
2021-11-16 13:11:53 +01:00
Christoph M. Becker d14a9139d5 [ci skip] Fix news entry for bug #79971 2021-11-16 13:06:04 +01:00
Nikita Popov 9e25c4b3a6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fixed bug #81626
2021-11-16 12:46:20 +01:00
Nikita Popov d26965b247 Fixed bug #81626
Backport of a8926474cb to 7.4.
2021-11-16 12:45:33 +01:00
Nikita Popov 1c25c556dc Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Safely reassign array in usort()
2021-11-16 10:16:35 +01:00
Nikita Popov 18a0d46a1b Safely reassign array in usort()
Make sure to destroy the old value only after assigning the new
one. Otherwise we may try to double free, e.g. if GC runs during
this dtor.

This caused an assertion failure in phpro/grumphp and is likely
the cause for bug #81603 as well.

(cherry picked from commit 6f38acfaf9)

(I applied this to the wrong base branch at first...)
2021-11-16 10:15:47 +01:00
Nikita Popov 6f38acfaf9 Safely reassign array in usort()
Make sure to destroy the old value only after assigning the new
one. Otherwise we may try to double free, e.g. if GC runs during
this dtor.

This caused an assertion failure in phpro/grumphp and is likely
the cause for bug #81603 as well.
2021-11-16 10:13:46 +01:00
Dmitry Stogov fc35a6b93c Tracing JIT: Fixed abstract stack consistency for [QM_]ASSIGN of CV to itself 2021-11-15 23:25:16 +03:00
Dmitry Stogov 85066fd88e Tracing JIT: Fixed failure on non-optimized op_arrays (op_array->T may be above ssa->vars_count) 2021-11-15 14:44:01 +03:00
Nikita Popov 4a2656327d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81618: Correct dns_get_record on FreeBSD
2021-11-15 10:00:36 +01:00
Matt 45f52285f6 Fix bug #81618: Correct dns_get_record on FreeBSD
Modify dns_get_record to test for records result based on dns_errno to
accommodate modern FreeBSD, for which res_nsearch() does not update
h_errno directly. Add new php_dns_errno macro, and have it consult
statp->res_h_errno when OS has res_nsearch().

Closes GH-7655.
2021-11-15 10:00:07 +01:00
Dmitry Stogov 292d76d8a4 JIT: Fixed reference-counting inference 2021-11-15 10:39:58 +03:00
Stanislav Malyshev 7967875d70 [ci skip] Update NEWS 2021-11-14 23:35:26 -08:00
Stanislav Malyshev 0ef1dfc9f6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:29:27 -08:00
Stanislav Malyshev ca87d46a3e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79971: special character is breaking the path in xml function
2021-11-14 23:28:13 -08:00
Christoph M. Becker f15f8fc573 Fix #79971: special character is breaking the path in xml function
The libxml based XML functions accepting a filename actually accept
URIs with possibly percent-encoded characters.  Percent-encoded NUL
bytes lead to truncation, like non-encoded NUL bytes would.  We catch
those, and let the functions fail with a respective warning.
2021-11-14 23:24:33 -08:00
Jakub Zelenka ec3d4409a4 Merge branch 'PHP-7.4' into PHP-8.0 2021-11-14 20:10:42 +00:00
Jakub Zelenka b2cf9b7ec7 Fix bug #81513 (Future possibility for heap overflow in FPM zlog)
This fixes currently unused code path in zlog that could lead to
the heap overflow in the future.
2021-11-14 20:08:57 +00:00
Dmitry Stogov 64fde17042 Fixed test 2021-11-12 22:48:50 +03:00
Dmitry Stogov 12d02e6227 Fixed incorrect guard elimination 2021-11-12 21:00:08 +03:00
David Carlier b1e6fdefd4 Fix leaks for AppArmor based distros in case the profile creation fails
Closes GH-7646.
2021-11-12 14:25:52 +01:00
Dmitry Stogov 5380b415a2 JIT: Partially fix handling of exceptions thrown in interrupt handlers 2021-11-11 21:14:17 +03:00
Dmitry Stogov fa0b84a06b Partially fix handling of exceptions thrown in interrupt handlers 2021-11-11 20:59:56 +03:00
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