Commit graph

1006 commits

Author SHA1 Message Date
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
Nikita Popov
8971728383 Merge branch 'PHP-7.4' 2019-03-20 12:07:05 +01:00
Nikita Popov
abc457fe1d Fixed bug #74345
Export zend_release_fcall_info_cache(). It is only necessary to
call it if the fcc may not have been used -- if it is passed to
zend_call_function() and friends, then they will take care of
freeing trampolines.
2019-03-20 12:06:42 +01:00
Nikita Popov
92291ab726 Merge branch 'PHP-7.4' 2019-03-11 14:33:07 +01:00
Nikita Popov
ac79d42ba6 Free trampolines from get_closure in is_callable
Also extract this logic into a function, as it's duplicated a few times.
2019-03-11 14:00:33 +01:00
Nikita Popov
513b76794b Make zpp failures always throw, independent of strict_types
Previously zend_parse_parameters (and FastZPP) would handle invalid
arguments depending on strict_types: With strict_types=1, a TypeError
is thrown, with strict_types=0 a warning is thrown and (usually) NULL
is returned. Additionally, some functions (constructors always and
other methods sometimes) opt-it to throwing regardless of strict_types.

This commit changes zpp to always generate a TypeError exception in
PHP 8.
2019-03-11 11:32:20 +01:00
Dmitry Stogov
96a9990a81 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use "quick" macro variants for known argument numbers
2019-02-18 17:53:43 +03:00
Dmitry Stogov
2ed013c38a Use "quick" macro variants for known argument numbers 2019-02-18 17:52:33 +03:00
Nikita Popov
903821b1c7 Merge branch 'PHP-7.4' 2019-02-15 11:28:14 +01:00
Nikita Popov
3cafa7f4df Assign (un)serialize_func during compilation
This avoids writing this cache at runtime, which is illegal if
preloading is used.

Not every serialize/unserialize function actually belongs to the
Serializable interface, but I think it's not a problem to assign
these anyway -- whether they are used ultimately depends on whether
Serializable is implemented.

Alternatively it might make sense to just drop these entirely. I
don't think this is performance critical functionality.
2019-02-15 11:20:28 +01:00
Dmitry Stogov
4474cf43e6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal)
2019-02-14 13:18:45 +03:00
Dmitry Stogov
43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03:00