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

123038 Commits

Author SHA1 Message Date
Nikita Popov
db2e2af13a Fixed bug #53826
We should handle the case where the method doesn't exist, and
where it is not visible the same way.
2021-02-18 14:17:47 +01:00
Dmitry Stogov
6e988eaefb We don't need map_ptr slots for op_array.run_time_cache during preloading. 2021-02-18 15:46:48 +03:00
Máté Kocsis
4f4c031f62 Generate ext/spl class entries from stubs
Closes GH-6709
2021-02-18 13:01:51 +01:00
Nikita Popov
6b0f14fe3b Fixed bug #75474
For fake closures, we need to share static variables with the
original function, not work on a separate copy. Calling a function
through Closure::fromCallable() should have the same behavior as
calling it directly.
2021-02-18 11:39:28 +01:00
Nikita Popov
5d160e309e Fix static variable behavior with inheritance
When a method is inherited, the static variables will now always
use the initial values, rather than the values at the time of
inheritance. As such, behavior no longer depends on whether
inheritance happens before or after a method has been called.

This is implemented by always keeping static_variables as the
original values, and static_variables_ptr as the modified copy.

Closes GH-6705.
2021-02-18 11:18:19 +01:00
Nikita Popov
e03284739f Initialize property to UNDEF on unserialize overwrite
The UNDEF marker here is important to prevent the creation of
a reference to the property currently being overwritten, which
would then leak.

This fixes oss-fuzz 6029559193534464, which was incorrectly
merged into oss-fuzz #30584 (which is reported at
https://github.com/google/oss-fuzz/issues/5211).
2021-02-18 11:10:20 +01:00
Nikita Popov
4fdaf84cc3 Merge branch 'PHP-8.0'
* PHP-8.0:
  Avoid signed integer overflow in substr()
2021-02-18 10:35:17 +01:00
Nikita Popov
85ffe8dcdc Avoid signed integer overflow in substr()
Perform negation after the (size_t) cast rather than before,
so as to avoid a signed integer overflow for PHP_INT_MIN.

Fixes oss-fuzz #31069.
2021-02-18 10:34:54 +01:00
Nikita Popov
b87080f3c2 Don't use unmangled name if property not found
This restores the previous behavior for this case. We'll continue
to use the mangled name, even if it does not correspond to a
declared property.

This also fixes an assertion failure for the case of property
overwrite, as the add_new was not guaranteed to be "new" previously.

Fixes oss-fuzz #31045.
2021-02-18 10:17:23 +01:00
Christoph M. Becker
b074e3b52b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fix #80763: msgfmt_format() does not accept DateTime references
2021-02-17 17:31:47 +01:00
Christoph M. Becker
553a0c52b1 Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80763: msgfmt_format() does not accept DateTime references
2021-02-17 17:30:47 +01:00
Christoph M. Becker
84b6152842 Fix #80763: msgfmt_format() does not accept DateTime references
`intl_zval_to_millis()` needs to cater to references.

Closes GH-6707.
2021-02-17 17:26:48 +01:00
Nikita Popov
de5b42219c Avoid writing zend_vm_opcodes.h if it did not change
Now that we track header changes, a change to zend_vm_opcodes.h
requires rebuilding essentially the whole tree. In most cases,
changes to zend_vm_def.h don't actually result in any header
changes though.

Avoid touching the file by first checking whether the to be written
contents are actually the same.
2021-02-17 17:18:57 +01:00
Alex Erohin
cbfdc1fd54 Coding style tweaks for zend_vm_gen.php
- fixed array style for $vm_kind_name and $op_types
- deleted unnecessary else statement for is_hot_helper function
- fixed concatenation style
- fixed style of using whitespace between "(" and switch/foreach - replaced !is_null with "!=="

Closes GH-6704.
2021-02-17 17:05:34 +01:00
Nikita Popov
4ea90c15de Merge branch 'PHP-8.0'
* PHP-8.0:
  Color LEAK&FAIL like a failure
2021-02-17 16:40:33 +01:00
Nikita Popov
cbdd21a22d Color LEAK&FAIL like a failure 2021-02-17 16:40:19 +01:00
Sara Golemon
922fb12121 Merge branch 'PHP-8.0'
* PHP-8.0:
  Prep for 8.0.4
2021-02-17 15:25:37 +00:00
Sara Golemon
8c6db654e7 Prep for 8.0.4 2021-02-17 15:24:43 +00:00
Dmitry Stogov
76b3635607 unserialize() optimization. Omit class name validation before hash lookup, and perform it only before autoloading. 2021-02-17 13:30:52 +03:00
Dmitry Stogov
5c78e87399 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts)
2021-02-17 11:51:50 +03:00
Dmitry Stogov
7f68a7afe6 Fixed bug #80745 (JIT produces Assert failure and UNKNOWN:0 var_dumps in code involving bitshifts) 2021-02-17 11:51:13 +03:00
Nikita Popov
bbb86ba7e2 Merge branch 'PHP-8.0'
* PHP-8.0:
  Remove generated zend_jit_x86.c on `make clean`
2021-02-17 09:45:31 +01:00
Dylan T
408272b8d9 Remove generated zend_jit_x86.c on make clean
Not removing this causes build failure when reconfiguring and rebuilding after a `make clean`, e.g. enabling/disabling ZTS.

This makes https://bugs.php.net/bug.php?id=80561 more bearable. Ideally it would be rebuilt automatically on configuration change if necessary, but I have no idea how to implement this.

Closes GH-6702.
2021-02-17 09:45:12 +01:00
Dmitry Stogov
319f73e06b Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true)
2021-02-16 20:02:48 +03:00
Dmitry Stogov
fad87a24da Fixed bug #80742 (Opcache JIT makes some boolean logic unexpectedly be true) 2021-02-16 20:02:12 +03:00
Máté Kocsis
803779e84b Add support for generating properties with union type of multiple classes
Closes GH-6701
2021-02-16 15:50:13 +01:00
Nikita Popov
6bfe1aa19a Merge branch 'PHP-8.0'
* PHP-8.0:
  Handle incomplete result set metadata more gracefully
2021-02-16 15:35:01 +01:00
Nikita Popov
edb9229b8b Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Handle incomplete result set metadata more gracefully
2021-02-16 15:34:47 +01:00
Nikita Popov
9552cf6b84 Handle incomplete result set metadata more gracefully
Rather than segfaulting because sname is missing lateron, report
a FAIL here. As this indicates a server bug, the errors is reported
as an out of band warning, rather than a client error.

This fixes the PHP side of bug #80713.
2021-02-16 15:34:14 +01:00
Máté Kocsis
cad66533f0 Generate class entries from stubs for ldap, libxml, mbstring and mysqli
Closes GH-6684
2021-02-16 14:46:19 +01:00
Nikita Popov
8b4ae72efb Fix unused variable warning 2021-02-16 14:24:58 +01:00
Nikita Popov
ce0bc58c22 Merge branch 'PHP-8.0'
* PHP-8.0:
  Mark resource-like objects as non-comparable
2021-02-16 14:22:03 +01:00
Nikita Popov
b63ea1047a Mark resource-like objects as non-comparable
As these hold on to some internal resource, there can't be two
"equal" objects with different identity. Make sure the lack of
public properties doesn't result in these being treated as always
equal.
2021-02-16 14:20:45 +01:00
Dmitry Stogov
081349fe16 Improved unserialize() performance. Checks for object propery "visibility change" were moved, to be performed only if name/visibility had been really changed. 2021-02-16 15:27:58 +03:00
Máté Kocsis
bf0f6aaf18 Improve class entry generation
Related to GH-6701
2021-02-16 13:09:56 +01:00
Nikita Popov
1f04f162a6 Merge branch 'PHP-8.0'
* PHP-8.0:
  Fixed bug #80723
2021-02-16 12:34:00 +01:00
Nikita Popov
cb9785add1 Fixed bug #80723
This fixes the issue just for the Socket class. Presumably we'll
want to do the same for other "resource" objects.
2021-02-16 12:33:50 +01:00
Derick Rethans
2fe6df771f Merge branch 'PHP-8.0' 2021-02-16 11:31:53 +00:00
Derick Rethans
2dc75a9e93 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:31:43 +00:00
Derick Rethans
2d858fbfb1 Fixed dates 2021-02-16 11:31:34 +00:00
Derick Rethans
e3bb2c9d9a Merge branch 'PHP-8.0' 2021-02-16 11:27:24 +00:00
Derick Rethans
f73e419996 Merge branch 'PHP-7.4' into PHP-8.0 2021-02-16 11:27:17 +00:00
Derick Rethans
6d3d9104e6 PHP-7.4 is now 7.4.17-dev 2021-02-16 11:26:47 +00:00
Dmitry Stogov
f8cf7152a9 Microoptimization of STRLEN and IN_ARRAY opcodes (based on https://github.com/php/php-src/pull/4981) 2021-02-16 14:11:47 +03:00
Nikita Popov
eb8ad30cf1 Fix quadratic slowdown under asan in timelib
This is a hotfix for https://github.com/derickr/timelib/pull/94
until the issue is resolved upstream.
2021-02-16 11:56:17 +01:00
Florian Sowade
c4d508c2bc Add dependency tracking for header files
This ensures all .c files which include a header file directly or
indirectly are rebuilt whenever the header file is changed.

Closes GH-6693.
2021-02-16 10:50:03 +01:00
Alexander Moskalev
e727919b97 cURL: make possible to send file from buffer string
Add CURLStringFile class which works similarly to CURLFile, but
uploads a file from a string rather than a file. This avoids the
need to create a temporary file, or use of a data:// stream.

Basic usage:

    $file = new CURLStringFile($data, 'filename.txt', 'text/plain');
    curl_setopt($curl, CURLOPT_POSTFIELDS, ['file' => $file]);

Closes GH-6456.
2021-02-16 10:24:22 +01:00
Nikita Popov
d16341dabe Merge branch 'PHP-8.0'
* PHP-8.0:
  Increase timeout on asan job
2021-02-16 10:16:13 +01:00
Nikita Popov
2d7ada2c0b Increase timeout on asan job
Regularly runs against the 5:10 hour limit on master. Increase it
to 6:00 hours.
2021-02-16 10:15:08 +01:00
Nikita Popov
45e6dc7beb Merge branch 'PHP-8.0'
* PHP-8.0:
  Suppress OpenSSL error on missing optional config
2021-02-16 10:12:59 +01:00