1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Commit Graph

59413 Commits

Author SHA1 Message Date
Kamil Tekiela db64aa3cfd optimize skip condition for the test 2021-06-25 13:35:48 +01:00
Kamil Tekiela f699c96ec3 Fix broken test due to missing skipif.inc 2021-06-25 13:26:40 +01:00
Kamil Tekiela 970d659dae Fix libmysql test cases (#7097)
Fixed test cases for: mysqli_stmt_execute_bind_libmysql, bug77935, fetch_column, and some others that failed on libmysql
2021-06-25 12:29:20 +01:00
Patrick Allaert 182e3ac0c3 Removing obsolete tests
Those were testing the `p` parameter for ZPP.
2021-06-23 19:06:50 +02:00
Patrick Allaert 3221a4cb4c Remove " " being considered as an invalid filename for is_file()
Some builds fail because of it, last one to date is: https://travis-ci.com/github/php/php-src/jobs/517817543
2021-06-23 19:06:50 +02:00
Dmitry Stogov 973ae8d3e2 Move the whole "cold" path into the "cold" function. 2021-06-23 14:55:58 +03:00
Hao Sun 3e164dee99 JIT/AArch64: Support shifted immediate (#7165)
* JIT/AArch64: Support shifted immediate

As pointed out by MikePall in [1], shifted immediate value is supported.
See [2]. For example, `add x0, x1, #4096` would be encoded by DynASM
into `add x0, x1, #1, lsl #12` directly.

In this patch, a helper is added to check whether an immediate value is
in the two allowed ranges: (1) 0 to 4095, and (2) LSL #12 on all the
values from the first range.

Note that this helper works for add/adds/sub/subs/cmp/cmn instructions.

[1] https://github.com/LuaJIT/LuaJIT/pull/718
[2]
https://github.com/LuaJIT/LuaJIT/blob/v2.1/dynasm/dasm_arm64.lua#L342

Change-Id: I4870048b9b8e6c429b73a4803af2a3b2d5ec0fbb

* Deprecatd CMP_IMM/ADD_SUB_IMM and add test cases

Macros CMP_IMM and ADD_SUB_IMM are deprecated and instead we use
this helper to guard the immediate encoding.

Add two 64-bit only test cases, since 64-bit integers are used
and tested inside.

Change-Id: I0b42d4617b40372e2f4ce5b6ad31a4ddb7d89e49
2021-06-23 17:18:03 +08:00
Remi Collet b83bfb2c54 make new API public (#7185) 2021-06-22 18:42:43 +02: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
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
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
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
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
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
Alex Dowad 4550036d96 Minor formatting tweaks in mbfilter_uhc.c 2021-06-17 13:12:40 +02:00
Alex Dowad 9868c17368 Mark CP932 and CP51932 encoding tests as 'slow tests' 2021-06-17 13:12:40 +02:00
Alex Dowad e2459857af Remove duplicate implementation of CP932 from mbstring
Sigh. Double sigh. After fruitlessly searching the Internet for information on
this mysterious text encoding called "SJIS-open", I wrote a script to try
converting every Unicode codepoint from 0-0xFFFF and compare the results from
different variants of Shift-JIS, to see which one "SJIS-open" would be most
similar to.

The result? It's just CP932. There is no difference at all. So why do we have
two implementations of CP932 in mbstring?

In case somebody, somewhere is using "SJIS-open" (or its aliases "SJIS-win" or
"SJIS-ms"), add these as aliases to CP932 so existing code will continue to
work.
2021-06-17 13:12:40 +02:00
Alex Dowad 7502c86342 Add test suite for UTF-{7,8,16,32}
Also fix a couple small problems with UTF-32 and UTF-8 support:

- UTF-32 would pass very large codepoints (>= 0x80000000), which are
  not valid.
- UTF-8 would sometimes emit two error marker characters for a single
  bad input byte.
2021-06-17 13:12:40 +02:00
Dmitry Stogov cc0aac3f73 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed incorrect type inference for "(array)$null".
2021-06-17 13:05:45 +03:00
Dmitry Stogov df16fd149b Fixed incorrect type inference for "(array)$null". 2021-06-17 13:03:09 +03:00
Nikita Popov c492c90a6e Fix mysqlnd debug formats on 32-bit 2021-06-16 17:08:20 +02:00
Nikita Popov 57f06b6058 Fix more mysqlnd debug printf formats
These didn't show up on my system...
2021-06-16 16:23:30 +02:00
Nikita Popov 3acdab864d Fix printf formats in mysql debug logging
Enable printf format verification and fix the reported errors.
2021-06-16 16:09:06 +02:00
Dmitry Stogov 3a78259525 JIT: Avoid too aggressive loop unrolling
This fixes tests/func/010.phpt failure with tracing JIT on ARM64.
2021-06-16 16:44:27 +03:00
Nikita Popov 591dcdbdb0 Use different error condition in ACCEL_LOG_FATAL test
This test fails on s390x with opcache. Presumably the large allocation
works fine there as long as it's not used.

Switch to a different error condition that produces a more reliable
failure.
2021-06-16 13:08:54 +02:00
Christoph M. Becker 46a6d481d3 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #72809: Locale::lookup() wrong result with canonicalize option
2021-06-16 10:38:14 +02:00
Christoph M. Becker 13f3999a77 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #72809: Locale::lookup() wrong result with canonicalize option
2021-06-16 10:36:51 +02:00
Christoph M. Becker 0f1b17e378 Fix #72809: Locale::lookup() wrong result with canonicalize option
Canonicalization converts the locale to ICU format[1].  However, the
lookup described in RFC 4647, section 3.4, is about POSIX format.  To
make that lookup work for ICU format, we also need to cater to keyword
separators.

The results are somewhat unexpected, but apparently canonical lookup is
explicitly supposed to return canonical language tags[2].

[1] <https://unicode-org.github.io/icu/userguide/locale/#canonicalization>
[2] <https://github.com/php/php-src/blob/php-7.4.20/ext/intl/locale/locale_methods.c#L1504>

Closes GH-7151.
2021-06-16 10:33:59 +02:00
Dmitry Stogov 8ae06582c6 Fixed incorrect map_ptr slots counting 2021-06-16 11:33:43 +03:00
Christoph M. Becker 139a73b5a4 Improve performance of AppVeyor test runs
We only load a minimum set of extensions, and rely on dynamic loading
of others due to `--EXTENSION--` triggers.  We do not run the imap,
ldap and snmp test suites, because most of the tests would be skipped
after timeouts anyway.

Closes GH-7150.
2021-06-14 23:36:17 +02:00
Aaron Piotrowski 859524c246 Remove fiber context embedding 2021-06-14 14:34:36 -05:00