1
0
mirror of https://github.com/php/php-src.git synced 2026-04-23 07:58:20 +02:00
Commit Graph

16299 Commits

Author SHA1 Message Date
Máté Kocsis 2e4d44509b Merge branch 'PHP-8.0' 2020-11-21 23:17:55 +01:00
Máté Kocsis 40ebfd6730 Remove some incorrect mixed parameter types 2020-11-21 23:17:35 +01:00
Nikita Popov 72ce6a131e Merge branch 'PHP-8.0'
* PHP-8.0:
  Export zend_is_callable_at_frame
2020-11-19 10:30:38 +01:00
Nikita Popov 46b9e0c874 Export zend_is_callable_at_frame
Export the zend_is_callable_impl() function as
zend_is_callable_at_frame() for use by extension. As twose pointed
out, an extension may want to retrieve fcc for a private method.
2020-11-19 10:29:32 +01:00
Nikita Popov a6bcad4a9e Merge branch 'PHP-8.0'
* PHP-8.0:
  Short-circuit get_gc for currently running generator
2020-11-18 12:46:32 +01:00
Nikita Popov bbc0dd402a Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Short-circuit get_gc for currently running generator
2020-11-18 12:46:12 +01:00
Nikita Popov 99a8ec6e24 Short-circuit get_gc for currently running generator 2020-11-18 12:45:29 +01:00
Nikita Popov 5bd7305cf0 Merge branch 'PHP-8.0'
* PHP-8.0:
  Provide unused retvals to observers
2020-11-17 10:30:20 +01:00
Sammy Kaye Powers 58d41b8c4f Provide unused retvals to observers
Make sure that the return value is available to observers, even if
it is not used by the caller.

Closes GH-6422.
2020-11-17 10:28:47 +01:00
Nikita Popov c4b2a40fdd Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix incorrectly optimized out live range
2020-11-17 10:20:52 +01:00
Nikita Popov 9cfb5261e4 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix incorrectly optimized out live range
2020-11-17 10:20:23 +01:00
Nikita Popov df7417d127 Fix incorrectly optimized out live range
For x ? y : z style structures, the live range starts at z, but
may also hold the value of y. Make sure that the refcounting check
takes this into account, by checking the type of a potential phi
user.
2020-11-17 10:19:57 +01:00
Sammy Kaye Powers e974becbb1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fire open observer end handlers after a zend_bailout
2020-11-16 15:13:29 -08:00
Sammy Kaye Powers 0425a6697a Fire open observer end handlers after a zend_bailout
Closes GH-6377
2020-11-16 15:12:57 -08:00
Christoph M. Becker fe27c5371e Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #74558: Can't rebind closure returned by Closure::fromCallable()
2020-11-16 14:34:52 +01:00
Christoph M. Becker c351768e4f Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #74558: Can't rebind closure returned by Closure::fromCallable()
2020-11-16 14:34:28 +01:00
Christoph M. Becker 78773890f6 Fix #74558: Can't rebind closure returned by Closure::fromCallable()
Failure to rebind such closures is not necessarily related to them
being created by `ReflectionFunctionAbstract::getClosure()`, so we fix
the error message.

Closes GH-6424.
2020-11-16 14:31:06 +01:00
Dmitry Stogov a15d215f75 Merge branch 'PHP-8.0'
* PHP-8.0:
  [Observer] Save opline before calling begin/end handlers
2020-11-11 13:07:12 +03:00
Dmitry Stogov 855d8fa68f [Observer] Save opline before calling begin/end handlers 2020-11-11 13:06:55 +03:00
Alex Dowad ad7e0f16cc Fix mbstring support for Shift-JIS
- Reject otherwise valid kuten codes which don't map to anything in JIS X 0208.
- Handle truncated multi-byte characters as an error.
- Convert Shift-JIS 0x7E to Unicode 0x203E (overline) as recommended by the
  Unicode Consortium, and as iconv does.
- Convert Shift-JIS 0x5C to Unicode 0xA5 (yen sign) as recommended by the
  Unicode Consortium, and as iconv does.
  (NOTE: This will affect PHP scripts which use an internal encoding of
  Shift-JIS! PHP assigns a special meaning to 0x5C, the backslash. For example,
  it is used for escapes in double-quoted strings. Mapping the Shift-JIS yen
  sign to the Unicode yen sign means the yen sign will not be usable for
  C escapes in double-quoted strings. Japanese PHP programmers who want to
  write their source code in Shift-JIS for some strange reason will have to
  use the JIS X 0208 backlash or 'REVERSE SOLIDUS' character for their C
  escapes.)
- Convert Unicode 0x5C (backslash) to Shift-JIS 0x815F (reverse solidus).
- Immediately handle error if first Shift-JIS byte is over 0xEF, rather than
  waiting to see the next byte. (Previously, the value used was 0xFC, which is
  the limit for the 2nd byte and not the 1st byte of a multi-byte character.)
- Don't allow 'control characters' to appear in the middle of a multi-byte
  character.

The test case for bug 47399 is now obsolete. That test assumed that a number
of Shift-JIS byte sequences which don't map to any character were 'valid'
(because the byte values were within the legal ranges).
2020-11-09 13:45:16 +02:00
Nikita Popov 31d975a461 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80334
2020-11-09 10:19:40 +01:00
Nikita Popov 6fb3d92525 Fixed bug #80334
If assert() was called with named args, add description as named
arg as well.
2020-11-09 10:19:32 +01:00
Nikita Popov c380812ed2 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix static variable in methods inheritance during preloading
2020-11-04 15:43:00 +01:00
Nikita Popov 670fe594b9 Fix static variable in methods inheritance during preloading
This is now "bug compatible" with the normal behavior, and more
imporantly, does not crash :)
2020-11-04 15:42:52 +01:00
Nikita Popov 3f400a7981 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't xfail method_static_var.phpt
2020-11-04 12:31:28 +01:00
Nikita Popov 57b0e5a045 Don't xfail method_static_var.phpt
Let's test the current behavior here. It might not be right, but
it's long-standing behavior.

Nearly missed an assertion failure here because the test was
XFAILed...
2020-11-04 12:30:41 +01:00
Nikita Popov bae3a35ce6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't disable opcache for generic tests
2020-11-04 11:12:22 +01:00
Nikita Popov 9ed2f4898b Don't disable opcache for generic tests
Even if the original issue only reproduces without opcache, we
should still allow running them with and without opcache.
2020-11-04 11:12:12 +01:00
Nikita Popov 6457043a75 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix dynamic function definition in preload script
2020-11-04 10:56:24 +01:00
Nikita Popov c6563dddac Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix dynamic function definition in preload script
2020-11-04 10:55:59 +01:00
Nikita Popov e0d6c3f7ba Fix dynamic function definition in preload script
We should use normal function renaming if the function is declared
during preloading itself, rather than afterwards.

This fixes a regression introduced by
68f80be9d1.
2020-11-04 10:54:08 +01:00
Nikita Popov b43c455b98 Merge branch 'PHP-8.0'
* PHP-8.0:
  Don't disable early binding during preloading script
2020-11-03 16:47:42 +01:00
Nikita Popov 54668a449e Don't disable early binding during preloading script
We should only disable early binding during the opcache_compile_file()
calls, not inside the preloading script or anything it includes.
The right condition to check for is whether we compile the file
without execution, as declaring classes is "execution".
2020-11-03 16:45:13 +01:00
Nikita Popov 8d43896013 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix use of type copy ctor when importing trait properties
2020-11-03 15:30:00 +01:00
Nikita Popov 9fd8e00f1a Fix use of type copy ctor when importing trait properties
We shouldn't call the copy constructor inside the original type,
duh.
2020-11-03 15:29:18 +01:00
Nikita Popov fa7272780b Merge branch 'PHP-8.0'
* PHP-8.0:
  Allow unlinked classes when performing in_compilation variance check
2020-11-03 14:50:15 +01:00
Nikita Popov 7e55317558 Allow unlinked classes when performing in_compilation variance check
As preloading runs in in_compilation mode, we also need to allow
use of unlinked classes in lookup_class().
2020-11-03 14:49:10 +01:00
Nikita Popov b4b91a8240 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix variance checks on resolved union types
2020-11-03 14:19:53 +01:00
Nikita Popov ee934f8245 Fix variance checks on resolved union types
This is a bit annoying: When preloading is used, types might be
resolved during inheritance checks, so we need to deal with CE
types rather than just NAME types everywhere.
2020-11-03 14:19:15 +01:00
Nikita Popov 6e30a40c28 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix typo in UPGRADING
  Improved error message for typed class properties with null as default value
2020-11-03 09:35:20 +01:00
Bogdan Ungureanu 6d6fadeb0d Improved error message for typed class properties with null as default value
Closes GH-6396.
2020-11-03 09:28:53 +01:00
Alex Dowad 2ce15d9c8d Merge branch 'PHP-8.0' 2020-10-30 22:12:00 +02:00
Alex Dowad 526c624dc4 Fix test added in d44235acae 2020-10-30 22:11:27 +02:00
Alex Dowad e2dc80b4e4 Merge branch 'PHP-8.0' 2020-10-30 22:07:41 +02:00
Alex Dowad d44235acae Convert numeric string array keys to integers correctly in JITted code
While fixing bugs in mbstring, one of my new test cases failed with a strange
error message stating: 'Warning: Undefined array key 1...', when clearly the
array key had been set properly.

GDB'd that sucker and found that JIT'd PHP code was calling directly into
`zend_hash_add_new` (which was not converting the numeric string key to an
integer properly). But where was that code coming from? I examined the disasm,
looked up symbols to figure out where call instructions were going, then grepped
the codebase for those function names. It soon became clear that the disasm I
was looking at was compiled from `zend_jit_fetch_dim_w_helper`.
2020-10-30 22:07:08 +02:00
Nikita Popov ada2a55e07 Merge branch 'PHP-8.0'
* PHP-8.0:
  FIxed bug #80299
2020-10-30 17:24:02 +01:00
Nikita Popov 904c1b6589 FIxed bug #80299
The must_wrap was leaking across iterations.
2020-10-30 17:23:18 +01:00
Nikita Popov 3e2b127e63 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix SSA integrity violation for type inference in dead code
2020-10-30 15:52:59 +01:00
Nikita Popov 5958137dc5 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix SSA integrity violation for type inference in dead code
2020-10-30 15:52:46 +01:00
Nikita Popov 83738281eb Fix SSA integrity violation for type inference in dead code
The foreach body can never be executed and thus may contain empty
types. We should still uphold our SSA integrity invariants in that
case.
2020-10-30 15:52:10 +01:00