1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
Commit Graph

1017 Commits

Author SHA1 Message Date
Nikita Popov fea482ee5c Merge branch 'PHP-7.4' 2019-10-10 12:45:38 +02:00
Nikita Popov 12f4e9e020 Fix leak when property AST evaluation fails 2019-10-10 12:44:55 +02:00
Nikita Popov 7c1bc91e52 Merge branch 'PHP-7.4' 2019-10-08 17:19:52 +02:00
Nikita Popov 21148679d1 Handle "non well formed" exception during ZPP
Previously if the "non well formed" notice was converted into an
exception we'd still end up executing the function.

Also drop the now unnecessary EG(exception) checks in the engine.

Additionally remote a bogus exception in zend_is_callable: It
should only be writing to error, but not directly throwing.
2019-10-08 17:17:49 +02:00
Nikita Popov 0ebf2bdba0 Convert "Illegal offset type" warnings to exceptions 2019-09-27 13:00:07 +02:00
Christoph M. Becker 0c7124e6be Add check_only parameter to get_closure handler
`get_closure` handlers are called to check whether an object is
callable, and to actually get the closure, respectively.  The behavior
of the handler might differ for these two cases, particularly the
handler may throw in the latter case, but should not in the former.

Therefore we add a `check_only` parameter, to be able to distinguish
the desired purpose.
2019-09-24 16:08:42 +02:00
Nikita Popov 6276dd826b Use ZEND_TYPE_IS_SET() when checking for property types
Instead of a simple if or 0 comparison. This would no longer work
if zend_type is a struct.
2019-09-23 16:53:54 +02:00
Christoph M. Becker d6ef63db53 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #78543: is_callable() on FFI\CData throws Exception
2019-09-19 09:17:53 +02:00
Christoph M. Becker 9dfbcd7248 Fix #78543: is_callable() on FFI\CData throws Exception
If `Z_OBJ_HANDLER_P(callable, get_closure)` throws, we must not let the
exeception pass to userland, if called through `is_callable()`.
2019-09-19 09:13:22 +02:00
Nikita Popov 51ea7fc477 Merge branch 'PHP-7.4' 2019-08-23 17:01:49 +02:00
Nikita Popov 8807889ac2 Fix arginfo leak when using disabled_classes
Also remove the hack where scope is set to NULL in order to make
free_internal_arg_info work. Instead explicitly call it for class
methods.

This fixes the asan build for Zend/tests/bug77494.phpt.
2019-08-23 17:00:59 +02:00
Dmitry Stogov c713f589c1 Merge branch 'PHP-7.4'
* PHP-7.4:
  Initialize static_members_table
2019-07-22 12:03:35 +03:00
Dmitry Stogov 60dca2295d Initialize static_members_table 2019-07-22 12:02:16 +03:00
Dmitry Stogov 0e5ecc7a8f Merge branch 'PHP-7.4'
* PHP-7.4:
  Delay EG(exception) check on slow path
2019-07-08 14:13:02 +03:00
Dmitry Stogov 9a833438d1 Delay EG(exception) check on slow path 2019-07-08 13:56:34 +03:00
Nikita Popov aa2320b274 Merge branch 'PHP-7.4' 2019-06-28 16:39:57 +02:00
Nikita Popov 3698303540 Fix arginfo leak in disable_functions
Arginfo is allocated if types are used, we need to free it.
2019-06-28 16:38:46 +02:00
twosee 61f78de486 Constify some char* arguments or return values of ZEND_API
Closes GH-4247.
2019-06-12 16:49:32 +02:00
Nikita Popov e4fae9c061 Merge branch 'PHP-7.4' 2019-06-11 13:16:38 +02:00
Nikita Popov 8f8fcbbd39 Support full variance if autoloading is used
Keep track of delayed variance obligations and check them after
linking a class is otherwise finished. Obligations may either be
unresolved method compatibility (because the necessecary classes
aren't available yet) or open parent/interface dependencies. The
latter occur because we allow the use of not fully linked classes
as parents/interfaces now.

An important aspect of the implementation is we do not require
classes involved in variance checks to be fully linked in order for
the class to be fully linked. Because the involved types do have to
exist in the class table (as partially linked classes) and we do
check these for correct variance, we have the guarantee that either
those classes will successfully link lateron or generate an error,
but there is no way to actually use them until that point and as
such no possibility of violating the variance contract. This is
important because it ensures that a class declaration always either
errors or will produce an immediately usable class afterwards --
there are no cases where the finalization of the class declaration
has to be delayed until a later time, as earlier variants of this
patch did.

Because variance checks deal with classes in various stages of
linking, we need to use a special instanceof implementation that
supports this, and also introduce finer-grained flags that tell us
which parts have been linked already and which haven't.

Class autoloading for variance checks is delayed into a separate
stage after the class is otherwise linked and before delayed
variance obligations are processed. This separation is needed to
handle cases like A extends B extends C, where B is the autoload
root, but C is required to check variance. This could end up
loading C while the class structure of B is in an inconsistent
state.
2019-06-11 13:09:33 +02:00
Nikita Popov 7686b0b889 Merge branch 'PHP-7.4' 2019-06-05 14:53:50 +02:00
Nikita Popov a31f46421d Allow exceptions in __toString()
RFC: https://wiki.php.net/rfc/tostring_exceptions

And convert some object to string conversion related recoverable
fatal errors into Error exceptions.

Improve exception safety of internal code performing string
conversions.
2019-06-05 14:25:07 +02:00
Joe Watkins 29722c7a0d Merge branch 'PHP-7.4'
* PHP-7.4:
  Revert "Fix bug #62397 - disable_functions does not work with eval."
2019-06-03 11:20:23 +02:00
Joe Watkins ff96f25b12 Revert "Fix bug #62397 - disable_functions does not work with eval."
This reverts commit 050d299364.
2019-06-03 11:20:12 +02:00
Nikita Popov 321fe88935 Add Z_PARAM_NUMBER and use it for some functions 2019-06-03 10:14:05 +02:00
Nikita Popov 8a0965e3d6 Remove zpp L specifier
We don't use this internally anymore, and external usages should
be encouraged to move towards 'l'.
2019-06-03 09:39:17 +02:00
Dmitry Stogov b4a3b49eab Merge branch 'PHP-7.4'
* PHP-7.4:
  Better hot/cold code splitting
2019-05-31 12:22:08 +03:00
Dmitry Stogov 1df9f238fe Better hot/cold code splitting 2019-05-31 12:20:21 +03:00
Nikita Popov 45a0656e95 Remove get() object handler
Now that set() is gone, there is little point in keeping get(), as
it is essentially just a different way of writing cast_object()
now.

Closes GH-4202.
2019-05-29 17:15:19 +02:00
Dmitry Stogov 6d89553c48 Merge branch 'PHP-7.4'
* PHP-7.4:
  Mark "cold" functions
2019-05-29 11:50:27 +03:00
Dmitry Stogov e14d77335c Mark "cold" functions 2019-05-29 11:48:41 +03:00
Joe Watkins 9f94566ff8 Merge branch 'PHP-7.4'
* PHP-7.4:
  disabled functions must not have return type
  Restore the execute bit for run-tests.php
2019-05-29 08:32:06 +02:00
Joe Watkins cc598d1ea9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  disabled functions must not have return type
  Restore the execute bit for run-tests.php
2019-05-29 08:30:55 +02:00
Joe Watkins 6c73b2088a Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  disabled functions must not have return type
2019-05-29 08:30:41 +02:00
Joe Watkins 7821cc3b9f disabled functions must not have return type 2019-05-29 08:30:08 +02:00
Nikita Popov 13f675b858 Merge branch 'PHP-7.4' 2019-05-27 09:38:33 +02:00
Nikita Popov e6fac86dc3 Accept flags argument in zend_lookup_class_ex()
Instead of a single boolean, so we have space for extension here.
2019-05-27 09:36:25 +02:00
Peter Kokot a1de3e8ae0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Update changelogs
  Fix bug #62397 - disable_functions does not work with eval.
2019-05-15 00:00:14 +02:00
Benjamin Eberlei 050d299364 Fix bug #62397 - disable_functions does not work with eval. 2019-05-14 23:49:55 +02:00
Nikita Popov e9aa0337ab Fix more dl() interned string assertions 2019-04-18 12:14:07 +02:00
Nikita Popov 878e09c47c Merge branch 'PHP-7.4' 2019-04-18 12:10:21 +02:00
Nikita Popov 4aa78b67e7 Merge branch 'PHP-7.3' into PHP-7.4 2019-04-18 12:10:09 +02:00
Nikita Popov a5b7f3bd81 Fix more dl() interned string assertions 2019-04-18 12:08:09 +02:00
Nikita Popov 492a5d3ebe Merge branch 'PHP-7.4' 2019-04-18 10:11:51 +02:00
Nikita Popov ed4c24274b Fix dl() module unloading in post deactivate
FOREACH_END_DEL() does not call the destructor by itself, we need to
explicitly call it. Due to the missing dtor call the functions were
not unregistered early, which resulted in later shutdown segfaults.
2019-04-18 10:10:15 +02:00
Dmitry Stogov 2de2cb2a87 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
2019-04-17 19:32:46 +03:00
Dmitry Stogov 93c6a32b7c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning.
2019-04-17 19:32:34 +03:00
Dmitry Stogov ac12cc85aa Fixed dl() function. It failed in DEBUG build without opcache because of assert during string interning. 2019-04-17 19:31:28 +03:00
Dmitry Stogov 14b24340c8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77877 (call_user_func() passes $this to satatic methods).
2019-04-11 14:31:40 +03:00
Dmitry Stogov a1b7ccdfc6 Fixed bug #77877 (call_user_func() passes $this to satatic methods). 2019-04-11 14:24:04 +03:00