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

14022 Commits

Author SHA1 Message Date
Dmitry Stogov f80b1b0c56 Delay hash table allocation 2019-01-24 16:01:04 +03:00
Dmitry Stogov fd41b99d58 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:08:00 +03:00
Dmitry Stogov aa9a8dbda3 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #77494 (Disabling class causes segfault on member access)
2019-01-24 13:07:31 +03:00
Dmitry Stogov 73f222d722 Fixed bug #77494 (Disabling class causes segfault on member access) 2019-01-24 13:06:36 +03:00
Nikita Popov 1d984cc707 Merge branch 'PHP-7.3' 2019-01-24 10:58:24 +01:00
Nikita Popov e0f97ae7ec Merge branch 'PHP-7.2' into PHP-7.3 2019-01-24 10:57:45 +01:00
Nikita Popov 526344aa5e Add flag to disable jumptable optimization
This is useful for coverage. While it is currently safe to just
skip over the SWITCH_* opcodes, this may not be true in the future
due to opcache optimizations, so it's safer to disable emission of
SWITCH_* opcodes entirely.
2019-01-24 10:56:04 +01:00
Christoph M. Becker 19a9a6ba24 Prepare main branch for PHP 7.3.3 2019-01-22 14:04:03 +01:00
Nikita Popov a50198d0fe Implement ??= operator
RFC: https://wiki.php.net/rfc/null_coalesce_equal_operator

$a ??= $b is $a ?? ($a = $b), with the difference that $a is only
evaluated once, to the degree that this is possible. In particular
in $a[foo()] ?? $b function foo() is only ever called once.
However, the variable access themselves will be reevaluated.
2019-01-22 11:12:04 +01:00
Dmitry Stogov a3503f0402 Most opcodes that don't consume their OP1 operand, must be terminated with real consumer, and don't have to be checked.
These checks are replaced by ZEND_ASSERT.
2019-01-22 02:11:50 +03:00
Dmitry Stogov 960f922ed2 Fixed odd ROPE_ADD instruction placement. 2019-01-21 23:34:09 +03:00
Dmitry Stogov 97ccafd4c6 Live ranges construction optimization 2019-01-21 17:25:24 +03:00
Nikita Popov 3269e88468 Implement single-pass live range calculation
Instead of interleaving creation of live-ranges with the main
compiler code, compute them in a separate pass over the opcodes
as part of pass_two. Additionally, do not keep live ranges
synchronized during optimization in opcache and instead use the
same mechanism to recompute them after optimization.
2019-01-21 11:47:27 +01:00
Anatol Belski 1f4a04fb3f Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir
2019-01-19 02:39:42 +01:00
Anatol Belski 8b20e7b68b Fixed bug #77484 Zend engine crashes when calling realpath in invalid working dir 2019-01-19 02:36:51 +01:00
Dmitry Stogov c69d830d45 Micro-optimization 2019-01-18 12:43:42 +03:00
Dmitry Stogov 77db3d524e Optimize zend_handle_fetch_obj_flags() 2019-01-18 01:22:14 +03:00
Dmitry Stogov e6182bd4ea Improved ZEND_TRY_ASSIGN... API to avoid unnecessary double copying and reduce code bloat. 2019-01-18 00:53:48 +03:00
Dmitry Stogov 0941f25811 Removed useless Z_REFCOUNTED_P() checks. 2019-01-17 10:53:58 +03:00
Dmitry Stogov 8661b6dd5d Reduce slow code size 2019-01-16 14:26:32 +03:00
Dmitry Stogov 44f4370880 Micro-optimization 2019-01-16 12:49:28 +03:00
Dmitry Stogov 9f05f64240 Extend zend_get_property_offset() to return property_info for typed properties. 2019-01-16 11:56:53 +03:00
Dmitry Stogov cbfb3f3fff Fixed tests 2019-01-16 11:55:52 +03:00
Dmitry Stogov fd27fd4a15 Fixed and improved incorrect usage of value_type argument. 2019-01-16 11:06:19 +03:00
Dmitry Stogov 6a2d2af06a Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Fix param list for build without global reg
2019-01-16 02:30:15 +03:00
Dmitry Stogov 0b21a4ba45 Separated zend_assign_to_typed_prop() 2019-01-16 02:13:43 +03:00
Anatol Belski cd43a4629f Fix param list for build without global reg 2019-01-15 22:31:52 +01:00
Dmitry Stogov a5446cc01c Reuse zend_incdec_typed_ref() and separate zend_incdec_typed_prop() 2019-01-16 00:22:34 +03:00
Dmitry Stogov 938ba93f4a Separated zend_binary_assign_op_typed_ref() and zend_binary_assign_op_typed_prop() helpers 2019-01-15 18:49:05 +03:00
Dmitry Stogov 239305d12e Fixed uninitialized result of PRE_INC/PRE_DEC in case of exception.
Separated increment/decrement of typed reference into helper.
2019-01-15 18:03:46 +03:00
Nikita Popov 97fc84ca06 Add dummy get_gc handler for iterator wrapper
get_gc is assumed to be non-NULL in master, and get_gc can be called
on the iterator wrapper if during generator GC, so we need to define
this handler. For now it's just a dummy, though for full support we'd
have to also add a get_gc iterator handler that is called here.
2019-01-15 13:52:32 +01:00
Nikita Popov 61d00c0c55 Fix handling of UNDEF properties in compound assign
Restore NULLing of UNDEF values in get_property_ptr_ptr for the
BP_VAR_R and BP_VAR_RW cases.
2019-01-15 09:55:55 +01:00
Dmitry Stogov 6f6532d32b Use fastcall calling convention 2019-01-15 11:14:33 +03:00
Dmitry Stogov c87c6f81f0 Removed missed and unused function declaration 2019-01-15 10:28:01 +03:00
Nikita Popov 3b74e8c165 Merge branch 'PHP-7.3' 2019-01-14 11:45:07 +01:00
Nikita Popov c8c5a3ab8a Fixed bug #77447
By disabling asan for CPU support helpers used in ifunc resolvers.
2019-01-14 11:44:48 +01:00
Dmitry Stogov 7f053c2c49 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator)
2019-01-14 13:21:03 +03:00
Dmitry Stogov 920450534e Fixed bug #77263 (Segfault when using 2 RecursiveFilterIterator) 2019-01-14 13:18:28 +03:00
Nikita Popov d0fd2be642 Revert removal of private __clone() methods
I thought these were redundant, because we already NULL out the
clone_obj object handler. However, it turns out that reflection is
using private __clone() to determine clonability (isCloneable) for
the case where we only have a class, rather than an object.

As such, removing these methods would be a BC break.

This reverts commit e7131a4e9f.
This reverts commit 55bd88ce0d.
2019-01-14 09:19:30 +01:00
Nikita Popov e25e2bd9bd Change zend_try_array_init_size arg to uint32_t
If this is all the underlying API supports, it doesn't make sense to
accept something larger here...
2019-01-14 09:16:07 +01:00
Kalle Sommer Nielsen 1ff33f3161 Kill this new and insanely annoying warning
Nikita, if this is not the right way to go about it, then please amend it
2019-01-14 09:05:44 +02:00
Nikita Popov e219ec144e Implement typed properties
RFC: https://wiki.php.net/rfc/typed_properties_v2

This is a squash of PR #3734, which is a squash of PR #3313.

Co-authored-by: Bob Weinand <bobwei9@hotmail.com>
Co-authored-by: Joe Watkins <krakjoe@php.net>
Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2019-01-11 15:49:06 +01:00
Nikita Popov d6e32c6ba7 Require that write_property value is not a reference
We explicitly dereference values before claling write_property,
so no need to do duplicate work.
2019-01-09 17:09:48 +01:00
jvoisin fbdaabba62 Fix some sign-related issues in comparisons 2019-01-09 10:01:12 +01:00
Nikita Popov 466cf77aa4 Merge branch 'PHP-7.3' 2019-01-08 09:26:44 +01:00
Nikita Popov f7a7d32e65 Merge branch 'PHP-7.2' into PHP-7.3 2019-01-08 09:26:31 +01:00
twosee 6305119a51 Prefix error_code with underscore in FastZPP implementation
To avoid conflicts with parameter names.
2019-01-08 09:25:35 +01:00
Peter Kokot e1f101d798 Remove separate *nix system build for Zend engine
Removed files used to provide building Zend engine separately using
Autoconf and Automake:
  cd Zend && ./buildconf && ./configure

Since Zend engine is tightly integrated in the PHP code itself and
current root configure.ac and acinclude provide this patch removes
these. Removed files also included several obsolete macros and
Automake dependency which is not used in main *nix PHP build system.
2019-01-04 22:04:05 +01:00
Nikita Popov 9ca217f506 Resolve parent::class at compile-time if possible
And remove some dead code.
2019-01-04 12:10:22 +01:00
Nikita Popov a9e6667817 Detect invalid uses of parent:: during compilation
We already detect the case where we're entirely outside a class --
now also check whether there actually is a parent.

This is a minor BC break, in that code that was never executed
might have previously contained an invalid parent:: reference without
generating an error.
2019-01-04 11:55:41 +01:00