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

124686 Commits

Author SHA1 Message Date
Ben Ramsey
ac82c00640 The master branch is now for 8.1.0alpha3 2021-06-22 10:29:17 -05:00
Benjamin Eberlei
0ca5ab4fa5 Add host for php_network_getaddresses getaddrinfo failed error message. (#7181) 2021-06-22 17:18:09 +02:00
David CARLIER
c4a005bb2d exposing few macOS socket options to give hints how to handle data, 2021-06-22 09:43:56 -05:00
Juliette
fb70194850 UPGRADING: update information re: return type for internal methods (#7182)
As discussed in 7051.
2021-06-22 08:33:55 +02:00
Tyson Andre
e748dcacad Allow build/gen_stub.php to process multiple CLI file args (#7179)
E.g. `build/gen_stub.php *.stub.php` will generate `*_arginfo.h`
from multiple files.

Previously, gen_stub.php would silently ignore files after the first file.

Invoking gen_stub.php with no arguments will continue to process the entire
directory.
2021-06-20 15:14:01 -04:00
jianxind
28a1a6be08 phar: use crc32 bulk method instead. (#6099)
phar: use crc32 bulk method instead.

Benefit from the hardware crc32 computing.

Signed-off-by: Frank Du <frank.du@intel.com>
2021-06-19 22:21:21 +02:00
Anatol Belski
578b67da49 Merge branch 'PHP-8.0'
* PHP-8.0:
  NEWS: Add bug #81101 note
  NEWS: Add bug #81101 note
2021-06-19 16:55:03 +02:00
Anatol Belski
2b948720ab NEWS: Add bug #81101 note
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 16:54:11 +02:00
Anatol Belski
ad2d9d9804 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  NEWS: Add bug #81101 note
2021-06-19 16:52:11 +02:00
Anatol Belski
4d8eb892b9 NEWS: Add bug #81101 note
[ci skip]

Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 16:51:13 +02:00
Anatol Belski
8ac2ae8c3b Merge branch 'PHP-8.0'
* PHP-8.0:
  pcre: Workaround bug #81101
  pcre: Workaround bug #81101
2021-06-19 15:28:27 +02:00
Anatol Belski
f7ab7951f1 pcre: Workaround bug #81101
The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regression revealed.

A possible side effect might occur if a pattern uses (*COMMIT) or
(*MARK), which is however not a very broadly used syntax in PHP. Still
this should be observed and handled by possibly adding a possibility to
reverse PCRE2_NO_START_OPTIMIZE on the user side.

One test shows a behavior change, where instead of int 0 the match
would produce an error and return false. Except strict comparison
is used, this should be acceptable.

Signed-off-by: Anatol Belski <ab@php.net>
(cherry picked from commit d188ca7688)
Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 15:25:17 +02:00
Anatol Belski
ed431ea2f6 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  pcre: Workaround bug #81101
2021-06-19 15:24:50 +02:00
Anatol Belski
1a1d86d562 pcre: Workaround bug #81101
The way to fix it is to disable certain match start optimizaions. The
observed performance impact appears negligible ATM, compared to the
functional regression revealed.

A possible side effect might occur if a pattern uses (*COMMIT) or
(*MARK), which is however not a very broadly used syntax in PHP. Still
this should be observed and handled by possibly adding a possibility to
reverse PCRE2_NO_START_OPTIMIZE on the user side.

One test shows a behavior change, where instead of int 0 the match
would produce an error and return false. Except strict comparison
is used, this should be acceptable.

Signed-off-by: Anatol Belski <ab@php.net>
(cherry picked from commit d188ca7688)
Signed-off-by: Anatol Belski <ab@php.net>
2021-06-19 15:23:43 +02:00
Aaron Piotrowski
15dcdd7672 Remove copying of fiber result to transfer value
Removes unnecessary copying of fiber return value to transfer value. This zval was not used as the return of start/resume/throw, instead being destroyed when the fiber was dead. Now the zval initialized to NULL when starting the fiber is maintained as the transfer value and is subsequently returned from start/resume/throw.
2021-06-18 23:38:02 -05:00
Aaron Piotrowski
f71d62e3d2 Fiber cleanup
Add zend_fiber prefix to delegate_transfer_result().

Ensure status is set to INIT when initializing the fiber context in case memory is not zeroed.

Assert destination fiber context is not dead.

Update stack alloc failure messages.

getThis() -> ZEND_THIS
2021-06-18 23:37:35 -05:00
George Peter Banyard
c66fd72dbb Fix deprecated float to int tests
Missed those as they are not present on the 8.0 branch
2021-06-18 19:14:22 +01:00
George Peter Banyard
4939d2cec1 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test
  Fix bug #81159: Object to int warning when using an object as a string offset
  Fix bug #81163 indirect vars in __sleep
2021-06-18 18:11:46 +01:00
George Peter Banyard
351629ae15 Fix test
This seems to only be incorrect for the 8.0 branch
2021-06-18 18:09:27 +01:00
George Peter Banyard
f0fd5922ee Fix bug #81159: Object to int warning when using an object as a string offset
Closes GH-7167
2021-06-18 18:07:22 +01:00
Aaron Piotrowski
865fb353f5 Rename Fiber::this() to Fiber::getCurrent() (#7155) 2021-06-18 11:02:02 -05:00
Martin Schröder
c5f9cdedd6 Flexible fiber bailout handling (#7163) 2021-06-18 11:01:10 -05:00
George Peter Banyard
e9e06279c1 Refactor SplFixedArray (#7168)
* Move spl_offset_convert_to_long() to spl_fixedarray.c

It is only used there, which explains its weird offset semantics

* Refactor SplFixedArray offset handling
- Implement warning for resource type
- Throw a proper TypeError instead of a RuntimeException

* Use a proper Error to signal that [] cannot be used with SplFixedArray

* Refactor SplFixedArray has_dimension helper

* Drop some ZPP tests
2021-06-18 15:22:52 +01:00
Patrick Allaert
ceb6fa6dc0 Convert some recently introduced zend_bool to bool
As well as `scripts/dev/check_parameters.php` utility.

Cfr. 3e01f5afb1
2021-06-18 15:21:39 +01:00
Nikita Popov
be369dec70 Deduplicate code for handling zend_type in inference
This should be doing the same for the argument and the property
type case.
2021-06-18 11:37:15 +02:00
Joe Watkins
ed88daecf4 missing news/upgrading entry 2021-06-18 11:25:36 +02:00
Joe Watkins
fba439196e Fix bug #81163 __sleep allowed to return non-array 2021-06-18 11:23:01 +02:00
Nikita Popov
a30fab57eb Make can_elide_return_type_check() more robust
Rather than using def_info, check against the actual arg_info type.
As it is stored as a type mask nowadays, this is not much harder,
but more general and more robust as we don't need to deal with
inaccurate cases.
2021-06-18 11:17:32 +02:00
Joe Watkins
7bf930d014 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix bug #81163 indirect vars in __sleep
2021-06-18 11:17:03 +02:00
Joe Watkins
bc59b046c6 Fix bug #81163 indirect vars in __sleep 2021-06-18 11:16:26 +02:00
Nikita Popov
0d9269de75 Extract helper for fetching class entry in optimizer
This code is repeated a few time. Two occurrences additionally
contained checks for user classes in CG(class_table) with the
same file name, but as far as I know these should always be in
the script class_table, so I'm omitting the check here.
2021-06-18 10:48:48 +02:00
Martin Schröder
d4ead60672 Do not expose fiber VM state management (#7170) 2021-06-18 08:04:31 +02:00
George Peter Banyard
acb78035b6 Add proper EXTENSIONS section for tests in Zend/ 2021-06-18 01:05:05 +01:00
George Peter Banyard
ff1145943f Refactor spl_array_has_dimension_ex()
Use early returns instead of else blocks
Add comments, especially to explain why we need a check_empty == 2 check
2021-06-18 00:47:04 +01:00
Christoph M. Becker
22d700b66a Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix test in case fallocate(1) is available, but fails
2021-06-17 19:08:58 +02:00
Christoph M. Becker
3374adcd14 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix test in case fallocate(1) is available, but fails
2021-06-17 19:06:18 +02:00
Christoph M. Becker
99e7c5cea8 Fix test in case fallocate(1) is available, but fails
That happens on Travis s390x for whatever reasons.  Thus, instead of
checking for `fallocate -h`, we attempt the real allocation and skip if
that fails.
2021-06-17 19:05:07 +02:00
Dmitry Stogov
d72c320ff6 JIT/ARM64: Fixed possible incorrect register allocation 2021-06-17 18:43:15 +03:00
Dmitry Stogov
c02d7c4de8 Merge branch 'PHP-8.0'
* PHP-8.0:
  JIT/x86: Fixed possible incorrect register allocation
2021-06-17 18:42:57 +03:00
Dmitry Stogov
ced8e88438 JIT/x86: Fixed possible incorrect register allocation 2021-06-17 18:42:11 +03:00
Joe Watkins
6318040df2 remove specialized printing from phpdbg (#7156) 2021-06-17 14:22:33 +02:00
Dmitry Stogov
82bcc9b497 JIT/ARM64: Fixed "may be used uninitialized" compilation warning 2021-06-17 15:08:14 +03:00
Dmitry Stogov
6442cbfbc4 Merge branch 'PHP-8.0'
* PHP-8.0:
  JIT: Fixed failures of tracing JIT with CALL VM
2021-06-17 14:26:36 +03:00
Dmitry Stogov
1082669e24 JIT: Fixed failures of tracing JIT with CALL VM
This fixes:
- tests/lang/bug28800.phpt
- Zend/tests/settype_resource.phpt
- Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
2021-06-17 14:21:40 +03:00
Christoph M. Becker
83517340f6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files
2021-06-17 13:18:59 +02:00
Christoph M. Becker
8daed6d0f2 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files
2021-06-17 13:16:30 +02:00
Christoph M. Becker
2555efadbc Fix #81145: copy() and stream_copy_to_stream() fail for +4GB files
When mapping the file, we need to pass the proper `dwFileOffsetHigh`
instead of `0`.

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>

Closes GH-7158.
2021-06-17 13:13:47 +02:00
Alex Dowad
b1ab76f742 Minor formatting tweaks in mbfilter_euc_kr.c 2021-06-17 13:12:40 +02:00
Alex Dowad
958ef47d2b When flushing CP5022x conversion filter, also flush next filter in chain
All the mbstring encoding conversion filters do this. I missed it when
adding a flush function for CP5022x.
2021-06-17 13:12:40 +02:00
Alex Dowad
caeaa662ab Strict conversion of UHC text to Unicode
Previously, mbstring would accept a lot of things which were not valid
UHC text. No more.

- Don't allow single-byte control characters to appear where the 2nd
  byte of a multi-byte character should be.
- Validate that the 2nd byte of a multi-byte character is in the
  expected range.
- Treat it as an error if a multi-byte character is truncated.

Also add a test suite to confirm that UHC conversion (both to and from
Unicode) works according to spec.
2021-06-17 13:12:40 +02:00