Commit Graph

17445 Commits

Author SHA1 Message Date
Tyson Andre
32e2d97a26
Allow internal functions to declare if they support compile-time evaluation, add functions. (#7780)
https://wiki.php.net/rfc/strtolower-ascii means that these functions no longer
depend on the current locale in php 8.2. Before that, this was unsafe to
evaluate at compile time.

Followup to GH-7506

Add strcmp/strcasecmp/strtolower/strtoupper functions

Add bin2hex/hex2bin and related functions

Update test of garbage collection using strtolower to use something else to create a refcounted string
2021-12-20 09:27:06 -05:00
Christoph M. Becker
04b9049973
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT
2021-12-20 14:22:08 +01:00
Petr Sumbera
069bbf3e80
Fix zend_fibers.c build with ZEND_FIBER_UCONTEXT
Avoids (Solaris SPARC) issue:
  zend_fibers.c:77:9: error: unknown type name 'ucontext_t'

Closes GH-7773.
2021-12-20 14:21:50 +01:00
Dmitry Stogov
e4cf3f7420 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix incorrect optimization of ASSIGN_OP that may lead to memory leak
2021-12-20 15:17:45 +03:00
Dmitry Stogov
ca3f7b0a73 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect optimization of ASSIGN_OP that may lead to memory leak
2021-12-20 15:17:30 +03:00
Dmitry Stogov
6b60dc29de Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix type inference for INIT_ARRAY with invalid index
2021-12-20 11:46:45 +03:00
Dmitry Stogov
c8d10a8243 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix type inference for INIT_ARRAY with invalid index
2021-12-20 11:46:36 +03:00
Dmitry Stogov
192ea91deb Avoid useless symbol table reattaching on retutn from an included op_array 2021-12-16 21:44:43 +03:00
Dmitry Stogov
67bb79259b Don't execute INCLUDE for empty op_arrays. 2021-12-16 19:42:29 +03:00
Dmitry Stogov
79fac32d6b Don't call zend_attach/detach_symbol_table() for op_arrays without local variables 2021-12-16 17:37:01 +03:00
Tim Starling
8eee0d6130
Make strtolower() and strtoupper() do ASCII case conversion (#7506)
Implement RFC https://wiki.php.net/rfc/strtolower-ascii
2021-12-15 08:38:35 -05:00
Dmitry Stogov
faa143ca1b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix array clobbering by user error handler
2021-12-15 12:21:36 +03:00
Dmitry Stogov
75b2973974 Fix array clobbering by user error handler
Fixes oss-fuzz #42363
2021-12-15 12:20:37 +03:00
Dmitry Stogov
f583c4dfd2 Use 64-bit multiplication on 64-bit systems 2021-12-14 17:09:59 +03:00
Dmitry Stogov
623b3fc83f Merge branch 'PHP-8.1'
* PHP-8.1:
  Move common code into helper
2021-12-14 15:32:20 +03:00
Dmitry Stogov
b16fc350a4 Move common code into helper 2021-12-14 15:31:53 +03:00
Dmitry Stogov
1959bbfc1b Merge branch 'PHP-8.1'
* PHP-8.1:
  Combine ADDREF/DELREF
2021-12-13 22:54:57 +03:00
Dmitry Stogov
1e56b64759 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Combine ADDREF/DELREF
2021-12-13 22:54:45 +03:00
Dmitry Stogov
c787f42ceb Combine ADDREF/DELREF 2021-12-13 22:38:23 +03:00
Dmitry Stogov
d9926a109d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix array clobering by user error handler
2021-12-13 15:20:24 +03:00
Dmitry Stogov
76075823e7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix array clobering by user error handler
2021-12-13 15:20:16 +03:00
Dmitry Stogov
cbc0b1afeb Fix array clobering by user error handler
Fixes oss-fuzz #42234
2021-12-13 14:59:30 +03:00
Dmitry Stogov
2337c0516a Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix incorrect optimization that leads to memory leak
2021-12-13 13:25:47 +03:00
Dmitry Stogov
f8f0a650a7 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect optimization that leads to memory leak
2021-12-13 13:09:05 +03:00
Christoph M. Becker
dd6b1b7ef7
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-7757: Multi-inherited final constant causes fatal error
2021-12-12 22:23:07 +01:00
Christoph M. Becker
206c521a1f
Fix GH-7757: Multi-inherited final constant causes fatal error
"Diamond" inheritance of final constants is supposed to be supported.

Closes GH-7767.
2021-12-12 22:22:51 +01:00
Christoph M. Becker
fe2c13cda4
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-7759: Incorrect return types for hash() and hash_hmac()
2021-12-12 15:47:39 +01:00
Christoph M. Becker
a708db9c8a
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-7759: Incorrect return types for hash() and hash_hmac()
2021-12-12 15:47:19 +01:00
Tyson Andre
25bb229f57
Allocate less memory for EG(errors) when recording errors for opcache (#7744)
errors is an array of pointers, not an array of values.

Low importance since this is freed after opcache compiles a file and there are
typically no or very few errors.
2021-12-10 09:19:16 -05:00
Dmitry Stogov
bdcef24f4b Merge branch 'PHP-8.1'
* PHP-8.1:
  Remove range inference for booleans.
2021-12-10 14:44:21 +03:00
Dmitry Stogov
cfcee97ad6 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Remove range inference for booleans.
2021-12-10 14:33:36 +03:00
Christoph M. Becker
4013ebe431
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix #81585: cached_chunks are not counted to real_size on shutdown
2021-12-10 12:26:17 +01:00
Christoph M. Becker
2362722dcf
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81585: cached_chunks are not counted to real_size on shutdown
2021-12-10 12:25:44 +01:00
Christoph M. Becker
5675ebe649
Fix #81585: cached_chunks are not counted to real_size on shutdown
The amount of allocated system memory is kept in `real_size`, including
the allocated `cached_chunks`.  Thus, we need to keep the proper count
at the end of the shutdown.

Closes GH-7745.
2021-12-10 12:24:06 +01:00
Dmitry Stogov
abcf68387d Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix incorrect JMP optimization
2021-12-10 01:45:03 +03:00
Dmitry Stogov
363434bab2 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix incorrect JMP optimization
2021-12-10 01:44:55 +03:00
George Peter Banyard
da684582d7
ZEND_INIT_FCALL is only produced when function exists at compile time (#7728) 2021-12-09 17:15:59 +00:00
Dmitry Stogov
91734fc579 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix crush after compilation of nullsafe operator introduced in 307e476e86
2021-12-09 18:19:38 +03:00
Dmitry Stogov
7e080183f4 Fix crush after compilation of nullsafe operator introduced in 307e476e86
Now we flush only delayed opcodes realted to this nullsafe operator.

Fixes oss-fuzz #42152
2021-12-09 18:15:47 +03:00
Dmitry Stogov
90e5eed9db Merge branch 'PHP-8.1'
* PHP-8.1:
  Separate "cold" code
2021-12-07 11:47:01 +03:00
Dmitry Stogov
08f1d470fb Separate "cold" code 2021-12-07 11:46:32 +03:00
Nikita Popov
09e991f39f Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't convert assign op operand types in opcache
2021-12-06 21:57:29 +01:00
Nikita Popov
cf377eefa6 Don't convert assign op operand types in opcache
This is the same change as 56b18d478e
but for ASSIGN_OP. Changing the operand type may change the error
message and can result in different behavior with operator overloading.

As with the other patch, if there is strong interest this could be
added to the DFA pass instead, with an appropriate type check.
2021-12-06 21:56:04 +01:00
Dmitry Stogov
8a5c604c3e Merge branch 'PHP-8.1'
* PHP-8.1:
  Fixed incorrect DCE of a constructor call
2021-12-06 16:00:39 +03:00
Dmitry Stogov
572c09d373 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fixed incorrect DCE of a constructor call
2021-12-06 16:00:30 +03:00
Dmitry Stogov
fe1f613b75 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix use after free because of data clobbering by user error handler
2021-12-06 13:09:26 +03:00
Dmitry Stogov
5459ed4c2f Fix use after free because of data clobbering by user error handler
Fixes oss-fuzz #41692
2021-12-06 13:08:27 +03:00
Dmitry Stogov
ebb7b173b0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix refcount inferemce ($a += $a returns old array with RCN)
2021-12-06 11:32:02 +03:00
Dmitry Stogov
4ed10f3d47 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix refcount inferemce ($a += $a returns old array with RCN)
2021-12-06 11:31:51 +03:00
Ilija Tovilo
051b3967a9
Merge branch 'PHP-8.1'
* PHP-8.1:
  Improve final/abstract methods in interfaces error messages
2021-12-05 23:48:26 +01:00