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

126190 Commits

Author SHA1 Message Date
Nikita Popov
e6e47cb255 Merge branch 'PHP-8.1'
* PHP-8.1:
  Update stub to show default of ENT_HTML401 (for documentation)
2021-09-29 12:14:43 +02:00
Craig Francis
2b25ac6f3c Update stub to show default of ENT_HTML401 (for documentation)
Closes GH-7514.
2021-09-29 12:14:29 +02:00
Nikita Popov
3847839961 Merge branch 'PHP-8.1'
* PHP-8.1:
  Ignore generated files by tests in extension skeleton
2021-09-29 11:59:58 +02:00
Raphaël Jorel
3c52db1b57 Ignore generated files by tests in extension skeleton
Closes GH-7523.
2021-09-29 11:59:05 +02:00
Nikita Popov
fe9abf52fa Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix bug #75941: Fix compile failure on Solaris with clang
2021-09-29 11:46:23 +02:00
Jaromir Dolecek
26d28c3b42 Fix bug #75941: Fix compile failure on Solaris with clang
Closes GH-7525.
2021-09-29 11:44:47 +02:00
Hao Sun
0dd187373a Merge branch 'PHP-8.1'
* PHP-8.1:
  ARM64: range.phpt failed under RELEASE mode

Change-Id: Ia7d0e1e6710aaebc5968bd67a0c3ad324c809dd8
2021-09-29 09:15:44 +00:00
Hao Sun
cfa88b7579 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  ARM64: range.phpt failed under RELEASE mode

Change-Id: I10bec6995ea362ca98f7e607db7026598455b643
2021-09-29 09:15:31 +00:00
Nikita Popov
e7a0c5b8c8 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix inference for INIT_ARRAY with illegal offset type
2021-09-29 11:09:22 +02:00
Nikita Popov
944d653b3d Fix inference for INIT_ARRAY with illegal offset type
Extract assign_dim_array_result_type() helper that can be reused
for INIT_ARRAY and implements all this logic correctly.

Fixes oss-fuzz 5156868775870464.
2021-09-29 11:09:04 +02:00
Hao Sun
6f6fd27d2f ARM64: range.phpt failed under RELEASE mode
Test case "ext/standard/tests/array/range.phpt" failed on ARM64 machine
only under RELEASE mode.

How to reproduce it:
```
./buildconf -f; ./configure; make -j 128
make test TESTS="-d opcache.enable=1 -d opcache.enable_cli=1 ext/standard/tests/array/range.phpt"
```

Root cause:
I suspect the root cause is that on ARM64 machine, PHP RELEASE mode
produces different values for internal function range() compared to
DEBUG mode.

Take the downsized test case downsize-range.php [1] as an example. We
applied the check-element.diff patch to check the original values. Note
that we print out the floating point numbers with precision 16.

From the outputs in file output.md, we can see the 7-th and 9-th
elements are different between RELEASE and DEBUG.

To be honest, I didn't get where such difference comes from and probably
this is due to different compilation options used by RELEASED and DEBUG.

Fix:
After commit [2], serialize_precision is used for var_dump(). As a
result, the pre-set "precision=14" didn't work actually.

In this patch, we turn to set serialize_precision as 14 and therefore
the difference between RELEASE and DEBUG can be eliminated.

Note-1: this failue didn't occur on x86 machine.
Note-2: in my local test, this is the only test case which behaves
differently on ARM64 machine under RELEASE and DEBUG mode.

[1] https://gist.github.com/shqking/0d55abf8dbaafde4a00ea9304e71f06b
[2] https://github.com/php/php-src/commit/a939805

Change-Id: I9293e990925590f8d7cfb2462d8d760abf76069f
2021-09-29 09:07:17 +00:00
Nikita Popov
e1f98447d9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Handle throwing destructor in BIND_STATIC
2021-09-29 10:17:27 +02:00
Nikita Popov
9346da8964 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Handle throwing destructor in BIND_STATIC
2021-09-29 10:17:22 +02:00
Nikita Popov
ec54ffad1e Handle throwing destructor in BIND_STATIC
Fixes oss-fuzz #39406.
2021-09-29 10:17:05 +02:00
Nikita Popov
a7ae4926b0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Convert exception during delayed autoload to fatal error
  The PHP-8.1 branch is now for 8.1.0RC4
2021-09-29 10:05:45 +02:00
Nikita Popov
c8fa477064 Convert exception during delayed autoload to fatal error
Same as with other exceptions during inheritance, convert those
thrown during delayed class loading into fatal errors. We can't
properly deal with such exceptions, as inheritance cannot be
gracefully aborted at this point.

Fixes oss-fuzz #39405.
2021-09-29 10:03:23 +02:00
Tim Starling
da0c70508e Add upper case functions to zend_operators.c and use them (#7521)
Add a family of upper case conversion functions to zend_operators.c,
by analogy with the lower case functions.

Move the single-character conversion macros to the header so that they
can be used as a locale-independent replacement for tolower() and
toupper().

Factor out the ugly bits of the SSE2 case conversion so that the four
functions that use it are easy to read and processor-independent.

Use the new ASCII upper case functions in ext/xml, ext/pdo_dblib and as
an optimization for strtoupper() when the locale is "C".
2021-09-29 09:37:40 +02:00
Nikita Popov
9d8f97d58d Revert "Fix DATE_FORMAT_COOKIE definition"
This reverts commit ac34648cf6.

As pointed out on GH-6783, the new format doesn't match any of
the specified formats. Previously the constant generated

    Thursday, 14-Jul-2005 22:30:41 BST

which is obsolete. Now it generates

    Thu, 14-Jul-2005 22:30:41 BST

which is not specified at all. The correct version would be:

    Thu, 14 Jul 2005 22:30:41 BST

Reverting the change for now.
2021-09-29 09:26:40 +02:00
Ben Ramsey
68ee1b40fc The PHP-8.1 branch is now for 8.1.0RC4 2021-09-28 16:34:46 -05:00
Dmitry Stogov
70545b78e0 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed NaN handling
2021-09-28 23:56:45 +03:00
Dmitry Stogov
c08ee7c760 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed NaN handling
2021-09-28 23:55:28 +03:00
Dmitry Stogov
7710047ed1 JIT x86: Fixed NaN handling 2021-09-28 23:49:26 +03:00
Dmitry Stogov
bcadbec54b Merge branch 'PHP-8.1'
* PHP-8.1:
  Tracing JIT: Fixed possible memory-leak or missed destructor call.
2021-09-28 22:41:57 +03:00
Dmitry Stogov
bae21b536b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Tracing JIT: Fixed possible memory-leak or missed destructor call.
2021-09-28 22:41:48 +03:00
Dmitry Stogov
c30298bf57 Tracing JIT: Fixed possible memory-leak or missed destructor call.
Reference-counter of return_value may be indirectly decremented to 1.
2021-09-28 22:40:04 +03:00
Nikita Popov
4df32817a1 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix leak with ASSIGN_OBJ on null
2021-09-28 16:34:45 +02:00
Nikita Popov
b5242fa19a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix leak with ASSIGN_OBJ on null
2021-09-28 16:34:32 +02:00
Nikita Popov
97b5eeeb6c Fix leak with ASSIGN_OBJ on null
We still need to free op1 in this case.

Fixes oss-fuzz 5782176231194624 (part of #38542).
2021-09-28 16:33:11 +02:00
Nikita Popov
b976ad09ab Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix leak of invalid stream_read() return value
2021-09-28 15:58:13 +02:00
Nikita Popov
f79bd08573 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix leak of invalid stream_read() return value
2021-09-28 15:58:05 +02:00
Nikita Popov
2f798d99b7 Fix leak of invalid stream_read() return value
Fixes oss-fuzz 6225190686687232 (part of #38542).
2021-09-28 15:57:55 +02:00
Christoph M. Becker
9800845d43 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
2021-09-28 15:55:40 +02:00
Christoph M. Becker
e73cc7aea9 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
2021-09-28 15:55:11 +02:00
Christoph M. Becker
6154aa652d Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
2021-09-28 15:52:58 +02:00
Christoph M. Becker
2d6684091f Fix #80663: Recursive SplFixedArray::setSize() may cause double-free
We address the `::setSize(0)` case by setting `array->element = NULL`
and `array->size = 0` before we destroy the elements.

Co-authored-by: Tyson Andre <tyson.andre@uwaterloo.ca>

Closes GH-7503.
2021-09-28 15:48:53 +02:00
Dmitry Stogov
db16a3af86 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed label mess
2021-09-28 15:23:18 +03:00
Dmitry Stogov
d0715aa779 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed label mess
2021-09-28 15:22:40 +03:00
Dmitry Stogov
3fd1f6cdad JIT: Fixed label mess 2021-09-28 15:21:11 +03:00
Nikita Popov
8b7874b262 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix ASSIGN_DIM result inference with typed refs
  Remove outdated code in ASSIGN_DIM type inference
2021-09-28 14:14:41 +02:00
Nikita Popov
69eb6e04a7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix ASSIGN_DIM result inference with typed refs
  Remove outdated code in ASSIGN_DIM type inference
2021-09-28 14:14:29 +02:00
Nikita Popov
1bb7ee3207 Fix ASSIGN_DIM result inference with typed refs
Same issue as with ASSIGN. Also make the handling for ASSIGN more
precise, we can only have conversions between scalar values.
2021-09-28 14:14:01 +02:00
Nikita Popov
cdc05eba61 Remove outdated code in ASSIGN_DIM type inference
All of these cases throw an exception now rather than returning
null.
2021-09-28 14:14:00 +02:00
Dmitry Stogov
04dd327493 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed result when assigning to typed reference
2021-09-28 14:27:29 +03:00
Dmitry Stogov
214cd1565b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: Fixed result when assigning to typed reference
2021-09-28 14:27:16 +03:00
Dmitry Stogov
17b127a84f JIT: Fixed result when assigning to typed reference 2021-09-28 14:19:23 +03:00
Nikita Popov
25c264245b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference and SCCP with typed references
2021-09-28 12:59:33 +02:00
Nikita Popov
2b71df71a1 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference and SCCP with typed references
2021-09-28 12:59:24 +02:00
Nikita Popov
d8c2ff6486 Fix type inference and SCCP with typed references
We can't assume that the return value will be the same as the RHS
if typed references are involved.
2021-09-28 12:59:00 +02:00
Nikita Popov
a836c286f3 Merge branch 'PHP-8.1'
* PHP-8.1:
  Check exception before using undef_result_after_exception()
2021-09-28 12:22:44 +02:00
Nikita Popov
b88c678127 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Check exception before using undef_result_after_exception()
2021-09-28 12:22:34 +02:00