Commit Graph

123197 Commits

Author SHA1 Message Date
Dmitry Stogov
f18bb2477f Fix type inference for INIT_ARRAY with invalid index
Fixes oss-fuzz #42568
2021-12-20 11:40:11 +03:00
Joe Rowell
1481d66343
[ci skip] Fix "The Mysterious PHP RFC Process" link.
Closes GH-7785.
2021-12-19 16:35:54 +01:00
Yifan Tong
3587e13ab3
Fix FILTER_FLAG_NO_RES_RANGE flag
`2001:10::/28` is a reserved IPv6 range. But there's a typo in GH-7476,
which caused IPv6 address like `240b:0010::1` will be filtered by the
flag `FILTER_FLAG_NO_RES_RANGE`.

http://www.faqs.org/rfcs/rfc6890.html

Closes GH-7790.
2021-12-19 16:24:34 +01:00
Dmitry Stogov
66306030ad JIT: Fix incorrect type store elimination
Fixes oss-fuzz #42388
2021-12-17 12:31:48 +03:00
Christoph M. Becker
49380b59d2
Fix #81679: Tracing JIT crashes on reattaching
When a new process reattaches to OPcache, tracing JIT causes segfaults,
because each new process allocates its own `zend_jit_traces` and
`zend_jit_exit_groups` in SHM, although these need to be shared between
all processes.

We solve that by only allocating these structs for the first process,
and store the pointers in `accel_shared_globals`, so we can reassign
them when a new process reattaches.

Closes GH-7776.
2021-12-15 15:37:23 +01:00
Dmitry Stogov
cd8e6f5f7b Preloading: don't remove INCLUDE_OE_EVAL nstructions with used result 2021-12-14 11:36:33 +03:00
Dmitry Stogov
c787f42ceb Combine ADDREF/DELREF 2021-12-13 22:38:23 +03:00
Dmitry Stogov
fe320e83ae Tracing JIT: Fix reference counting
Fixes oss-fuzz #42225
2021-12-13 16:28:45 +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
230de7721f Fix incorrect optimization that leads to memory leak
Fixes oss-fuzz #42221
2021-12-13 13:08:05 +03:00
Dmitry Stogov
e79dbe1124 JIT: Fix crash during compilation of function with incompletely constructed SSA
Fixes oss-fuzz #42200
2021-12-13 11:49:51 +03:00
Christoph M. Becker
c435e67746
Fix GH-7765: php_oci_cleanup_global_handles segfaults at second call
We must not use the TSRM accessor macros in GINIT and GSHUTDOWN, but
rather use the passed pointers directly.  For simplicity, we inline
`php_oci_cleanup_global_handles()`, and also the `PHP_OCI_CALL()`
macros; the latter are unlikely to be needed here, but don't hurt.

Closes GH-7766.
2021-12-12 22:38:00 +01:00
Christoph M. Becker
9998082a6a
[ci skip] Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  macOS 10.14 runners are no longer available via Azure Pipeline
2021-12-12 19:16:48 +01:00
Christoph M. Becker
6d5f2ba78d
macOS 10.14 runners are no longer available via Azure Pipeline
These images have already been deprecated for two months[1].  Thus,
we upgrade to macOS 10.15.  Since clang 12 is picky about
`int-in-bool-context` warning, we disable `-Werror`.

[1] <https://devblogs.microsoft.com/devops/hosted-pipelines-image-deprecation/>
2021-12-12 19:11:21 +01:00
Christoph M. Becker
0b3a937670
Fix GH-7759: Incorrect return types for hash() and hash_hmac()
`hash()` and `hash_hmac()` never return `false`; only `hash_file()` and
`hash_hmac_file()` return `false` in case the data cannot be read.

Closes GH-7760.
2021-12-12 15:39:55 +01:00
SATO Kentaro
778513f605
Fix error message allocation of PDO PgSQL
Closes GH-7723.
2021-12-12 15:17:36 +01:00
Christoph M. Becker
2c2b0abd4a
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix openssl_x509_checkpurpose_basic.phpt
2021-12-12 14:27:07 +01:00
Christoph M. Becker
98175fc7f1
Fix openssl_x509_checkpurpose_basic.phpt
This test fails because san-cert.pem and san-ca.pem have expired.  We
fix that by using the CertificateGenerator to generate temporary certs
during the test run.  Since san-cert.pem and san-ca.pem have been
identical, we only generate one certificate.

Closes GH-7763.
2021-12-12 14:26:17 +01:00
Dmitry Stogov
6f42c073cf Remove range inference for booleans.
Range inference for bolleans and longs comparison was incorrect.

Fizes oss-fuzz #fuzz-42161.php
2021-12-10 14:32:47 +03: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
0ac3d78d7d Fix incorrect JMP optimization
Fixes oss-fuzz #42155
2021-12-10 01:39:28 +03:00
Christoph M. Becker
efb901ebed
Skip bug_36798.phpt for PDO_DBLIB
For some reason, this test fails now with "Incorrect syntax near ''.
[SELECT '�' as test FROM test WHERE id = '1']", so we skip it.
2021-12-07 20:24:15 +01:00
Aliaksandr Bystry
daf79e2d91
Fix #75917: SplFileObject::seek broken with CSV flags
Closes GH-7697.
2021-12-06 18:59:48 +01:00
Dmitry Stogov
7b629afe4e Fixed incorrect DCE of a constructor call
Fixez oss-fuzz #42049
2021-12-06 15:59:30 +03:00
Dmitry Stogov
c29f6baaee JIT: Fix incorrect elimination of type store
Fixes oss-fuzz #41995
2021-12-06 14:22:07 +03:00
Dmitry Stogov
aa7280264e Fix refcount inferemce ($a += $a returns old array with RCN)
Fixes oss-fuzz #41670
2021-12-06 11:30:03 +03:00
Michael Wallner
1f38c003d2 fix #81656: GCC-11 silently ignores -R
Closes GH-7688.
2021-12-05 21:06:28 +01:00
Christoph M. Becker
582a291c98
Use php/php-sdk-binary-tools.git for AppVeyor builds 2021-12-05 13:51:50 +01:00
Dmitry Stogov
c9901aa594 Add missing "return" 2021-12-03 13:52:10 +03:00
Dmitry Stogov
8d7d87cdc4 Add test 2021-12-03 13:40:17 +03:00
Dmitry Stogov
4a5c05a49d ws 2021-12-03 13:40:01 +03:00
Dmitry Stogov
1d054b3fa7 Fix array object clobbering by user error handler
Fixes oss-fuss #41605 and #41610
2021-12-03 13:35:28 +03:00
Dmitry Stogov
2515e788bc JIT: Fix register clobbering
Fixes oss-fuzz #41621
2021-12-03 11:13:50 +03:00
Dmitry Stogov
c4ee66856e Tracing JIT: Fixed Zend/tests/str_offset_008.phpt failure 2021-12-02 23:47:36 +03:00
Dmitry Stogov
2fde308fc6 JIT: Fix ASSIGN_DIM_OP with undefined variable and index and user error handler, throwing an exception
Fixes oss-fuzz #39422
2021-12-02 22:19:48 +03:00
Dmitry Stogov
94286cd596 Fix yet another indirect string modification by error handler problem 2021-12-02 16:16:54 +03:00
Dmitry Stogov
37ac707cac Add missing zend_string_release_ex(tmp, 0) and cleanup
- use GC_DELREF() instead of zend_string_release_ex()
- add expectations for exceptional cases
- replace IS_ARRAY_IMMUTABLE by IS_STR_INTERNED
2021-12-02 11:18:08 +03:00
Dmitry Stogov
df16da3697 Fixed ext/bz2/tests/005.phpt test failure introduesed by 09547c64c2 2021-12-02 10:32:45 +03:00
Sara Golemon
999c6f2c5d
Bump for 8.0.15 2021-12-02 05:09:07 +00:00
Dmitry Stogov
4595a57e99 Fix clobering of operand by error handler in assignment to string offset (optimization and JIT support) 2021-12-02 01:20:17 +03:00
Dmitry Stogov
09547c64c2 Fix clobering of operand by error handler in assignment to string offset
In some cases new code requires two reallocations insead of one.

Fixes oss-fuzz #31716, #36196, #39739 and #40002
2021-12-02 00:24:05 +03:00
Dmitry Stogov
9f6ab78610 Use proper functions 2021-12-01 22:43:19 +03:00
Derick Rethans
977e132842 Merge branch 'PHP-7.4' into PHP-8.0 2021-11-30 18:41:16 +00:00
Derick Rethans
f533744c92 Prepare for 7.4.28 2021-11-30 18:40:42 +00:00
Dmitry Stogov
e7b31f57ec JIT: Fix incorrect code produced for BOOL_NOT and [double, undef] operand
Fixes oss-fuzz #41531
2021-11-30 20:36:52 +03:00
Dmitry Stogov
df434f056f Fix crash after indirect modification of string by user error handler
Fixes oss-fuzz #39346
2021-11-30 16:07:38 +03:00
Dmitry Stogov
c1036194d6 JIT: Fix incorrect reference counting inference
Fixes oss-fuzz #40747
2021-11-30 12:58:54 +03:00
Dmitry Stogov
6e1fe96962 JIT: Fix uninitialized result of ASSIGN_DIM[_OP] after clobbering array by user error handler
Fixes oss-fuzz #41208
2021-11-30 11:40:18 +03:00
Dmitry Stogov
86430e8e01 Fixed type inference (it's safe to ignore reference counting narrowing) 2021-11-29 23:32:52 +03:00
Dmitry Stogov
aff115547f JIT: Fix exception handling when next array element is already occupied
Fixes oss-fuzz #41408
2021-11-29 21:44:00 +03:00