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

6158 Commits

Author SHA1 Message Date
Gina Peter Banyard
a79c70f574 [RFC] Convert exit (and die) from language constructs to functions (#13483)
RFC: https://wiki.php.net/rfc/exit-as-function
2024-08-14 12:44:12 +01:00
Peter Kokot
540b9f5bc7 Autotools: Wrap long texts with m4_text_wrap (#15368)
The m4_text_wrap macro wraps the text into a single space separated
string which is wrapped to not exceed the line lenght of 79 characters
by default.
2024-08-13 10:33:17 +02:00
Arnaud Le Blanc
81150187fb Ensure proper alignment of zend_accel_shared_globals.interned_strings (#15359) 2024-08-12 21:43:43 +02:00
Peter Kokot
d334382eb8 [skip ci] Fix typo s/dissasembly/disassembly 2024-08-12 14:37:22 +02:00
Peter Kokot
b0091c4172 Autotools: Sync CS in opcache extension (#15340)
- AS_* macros used
- Overquoted AC_RUN_IFELSE macros arguments reduced
- Redundant double quoted single variables assignments removed
- i*86 and x86* patterns joined into a single case
2024-08-11 14:51:27 +02:00
Ilija Tovilo
46ee0fb304 Disallow indirect modification on readonly properties within __clone() (#15012)
Indirect modification isn't allowed in __construct() because it allows
references to leak, so it doesn't make much sense to allow it in __clone().
2024-08-09 11:56:16 +02:00
Ilija Tovilo
7a2d5efa0f [JIT] Avoid generating fast property assign path for readonly properties (#15260)
readonly properties will usually be IS_UNDEF on assignment, dodging the fast
path anyway. The fast path does not handle the readonly scope check. The
alternative would be handling scope there, but since there are some many
variants that might be more trouble than it's worth.
2024-08-09 11:49:40 +02:00
Peter Kokot
d6a75e19d1 Sync preprocessor macros help texts (#15218)
This partially syncs help texts a bit further for:
- ext/ffi
- ext/ldap
- ext/opcache
- ext/pcre
- ext/pdo_mysql
- ext/readline
- ext/standard
2024-08-04 12:52:16 +02:00
Peter Kokot
dcdcb3cbfe Autotools: Replace AC_MSG_ERROR with AC_MSG_FAILURE (#15209)
This replaces the AC_MSG_ERROR with AC_MSG_FAILURE, where appropriate.

The AC_MSG_ERROR outputs given message and exits the configure step. The
AC_MSG_FAILURE does the same but also automatically outputs additional
message "See 'config.log' for more details." which might help directing
the user where to look further.

The AC_MSG_ERROR is used for errors where current test step isn't logged
in the config.log and wouldn't make sense, and AC_MSG_FAILURE is mostly
used in cases of library checks, compilation tests, headers checked with
AC_CHECK_HEADER* and similar tests that are also logged in the
config.log.

AC_MSG_ERROR([Sanity check failed.]) output:

```
configure: error: Sanity check failed.
```

AC_MSG_FAILURE([Sanity check failed.]) output:

```
configure: error: in '/path/to/php-src':
configure: error: Sanity check failed.
See 'config.log' for more details
```
2024-08-04 07:36:37 +02:00
Peter Kokot
16d9bd0aae Sync AC_DEFINE help texts (#15207) 2024-08-03 09:47:39 +02:00
Ilija Tovilo
2e9cc9bc30 Allow optimizer to depend on preloaded symbols (#15021)
* Allow optimizer to depend on preloaded symbols

It is safe for the optimizer to rely on preloaded symbols. This can occur when
compiling non-preloaded files, referencing preloaded ones.

* Disable inline pass for observer test

* Move duplicated code into functions

* Add comment to specific optimization value

* Optimizer should only rely on preloaded symbols in the symbol table

* Fix skipif for windows
2024-08-02 17:35:27 +02:00
Dmitry Stogov
53b329e278 Fix GH-15101: _ir_RSTORE: Assertion `ctx->control' (#15153) 2024-07-29 19:17:25 +03:00
Peter Kokot
f3c48f1acd Autotools: Append hash and opcache build directories (#15132)
When building in out-of-source directory, instead of creating these
build directories right away, this appends them to the list and creates
them at the end of configure phase. These don't need to be created
immediately as no files are generated in these extensions before the
configure phase is finished.

Also, the PHP_ADD_BUILD_DIR is moved after the PHP_NEW_EXTENSION when
the more common $ext_builddir variable is available (the ext/<extension>
isn't available when building with phpize).
2024-07-29 10:02:11 +02:00
Niels Dossche
5270ada34c Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix nightly failure in test variation due to number of temp variables varying when observers are enabled
2024-07-27 16:37:14 +02:00
Niels Dossche
950d010cc5 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix nightly failure in test variation due to number of temp variables varying when observers are enabled
2024-07-27 16:37:09 +02:00
Niels Dossche
4df858602a Fix nightly failure in test variation due to number of temp variables varying when observers are enabled 2024-07-27 16:37:01 +02:00
Ilija Tovilo
a0a8624346 Fix throw in IS_IDENTICAL in JIT (#15103)
We need to persist opline in case zend_is_identical() throws.
2024-07-25 13:18:47 +02:00
Peter Kokot
da69755eca Autotools: Sync CS in opcache Capstone check (#15084)
- Added Capstone check message in configure log
- PKG_CHECK_MODULES already errors out by default if Capstone is not
  found with a bit more informative message
- Autoconf syntax used
- HAVE_CAPSTONE help text synced and updated
2024-07-24 19:55:01 +02:00
Peter Kokot
e3c1e3326c Autotools: Normalize ext/opcache sources (#15083)
- m4_normalize can simplify the list of source files
- PHP_NEW_EXTENSION arguments quoted and excessive shell double quotes
  character removed (macro already adds double quotes)
- Removed redundant shell variable parameter expansions
- Minor Autoconf CS syncs
2024-07-24 18:59:13 +02:00
Ilija Tovilo
8b6f14a9a2 Compile in opcache without COMPILE_IGNORE_INTERNAL_CLASSES (#15025) 2024-07-24 13:07:28 +02:00
Arnaud Le Blanc
d4ef8b97f5 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix build on platforms without JIT support (#15069)
2024-07-23 13:43:25 +02:00
Arnaud Le Blanc
385151d200 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix build on platforms without JIT support (#15069)
2024-07-23 13:43:13 +02:00
Arnaud Le Blanc
acf758d2ea Fix build on platforms without JIT support (#15069) 2024-07-23 13:42:47 +02:00
Arnaud Le Blanc
c60dbecb69 Merge branch 'PHP-8.3'
* PHP-8.3:
  [ci skip] NEWS
  Hint the opcache shm mapping location only when JIT is enabled
  Fix the JIT buffer relocation failure at the corner case (#11266)
2024-07-22 19:28:52 +02:00
Arnaud Le Blanc
ead61c7f29 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Hint the opcache shm mapping location only when JIT is enabled
  Fix the JIT buffer relocation failure at the corner case (#11266)
2024-07-22 19:28:05 +02:00
Arnaud Le Blanc
929536b697 Hint the opcache shm mapping location only when JIT is enabled
Closes GH-14793
Fixes GH-13775
2024-07-22 19:26:54 +02:00
LoongT4o
a924e1c71b Fix the JIT buffer relocation failure at the corner case (#11266)
Avoid missing possible candidates due to the large address range of the free segment.
Eg, 

48000000-49400000 r-xs 08000000 00:0f 39322841               segment1
7ffff2ec8000-7ffff2f49000 rw-p 00000000 00:00 0              segment2
7ffff6fae000-7ffff735c000 r-xp 00200000 08:02 11538515       /usr/local/sbin/php-fpm

original code will miss the opportunity between [7ffff2ec** - 7ffff2ec8000].

Fix issue #11265.

Signed-off-by: Long, Tao <tao.long@intel.com>
Signed-off-by: Dmitry Stogov <dmitrystogov@gmail.com>
2024-07-22 19:17:43 +02:00
Bob Weinand
e406ec81f4 Merge branch 'PHP-8.3' 2024-07-22 18:32:04 +02:00
Bob Weinand
61b455b59c Merge branch 'PHP-8.2' into PHP-8.3 2024-07-22 18:30:10 +02:00
Bob Weinand
a18df90a8b Fix GH-13817: Segmentation fault for enabled observers after pass 4
Instead of fixing up temporaries count in between observer steps, just apply the additional temporary in the two affected observer steps.

Closes GH-14018.
2024-07-22 18:28:03 +02:00
Dmitry Stogov
7b25cac32b Update IR
IR commit: 8fb33ceccd39d0052c5949cf96fc135e7ba1fbcb
2024-07-22 09:43:11 +03:00
Peter Kokot
f702437cad Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Append -Wno-implicit-fallthrough flag conditionally (#13331)
2024-07-22 06:58:01 +02:00
Peter Kokot
d20d11375f Append -Wno-implicit-fallthrough flag conditionally (#13331)
Older GCC versions (< 7.0) don't support the -Wno-implicit-fallthrough
compiler flag. This adds the flag conditionally in case some other
compiler will run into same issue.

Fixes GH-13330
2024-07-22 06:57:04 +02:00
Peter Kokot
68ae477796 Autotools: Quote M4 arguments (#15033)
- PHP_ADD_INCLUDE
- PHP_EVAL_INCLINE
- PHP_EVAL_LIBLINE
2024-07-20 07:21:44 +02:00
Ilija Tovilo
fdbe910b3b Fix indirect readonly error messages (#14979)
$obj->ro[] = 42;, passByRef($obj->ro); and the likes should emit an indirect
modification error message. This message already existed but was used
inconsistently.
2024-07-16 23:24:07 +02:00
Peter Kokot
a2bc783815 Autotools: Add missing sigil in AC_CASE and fix Autoconf syntax (#14967) 2024-07-16 08:55:22 +02:00
Peter Kokot
0e2e8e0f13 Autotools: Quote all PHP_ADD_BUILD_DIR arguments (#14947)
- All arguments quoted for consistency
- m4_normalize used where list of directories becomes a bit simpler to
  read and see the diff
2024-07-14 16:58:43 +02:00
Ilija Tovilo
780a8280d2 [RFC] Property hooks (#13455)
RFC: https://wiki.php.net/rfc/property-hooks

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2024-07-14 11:55:03 +02:00
Niels Dossche
1a07bb9252 Fix GH-14873: PHP 8.4 min function fails on typed integer
The problem is that this line in the VM: `ZVAL_NULL(result);` changes the type
of arg1 as well, because after the DFA pass the result and input both use
CV0($result).
We should not contract assignments with CVs in frameless calls with
arguments.
An older attempt is found at GH-14876 that tried to modify the VM/JIT.

Closes GH-14903.
2024-07-13 00:29:09 +02:00
Peter Kokot
9e94d2b040 Autotools: Refactor builtin checks (#14835)
This creates a single M4 macro PHP_CHECK_BUILTIN and removes other
PHP_CHECK_BUILTIN_* macros. Checks are wrapped in AC_CACHE_CHECK and
PHP_HAVE_BUILTIN_* CPP macro definitions are defined to 1 if builtin
is found and undefined if not.

This also changes all PHP_HAVE_BUILTIN_ symbols to be either undefined
or defined (to value 1) and syncs all #if/ifdef/defined usages of them
in the php-src code. This way it is simpler to use them because they
don't need to be defined to value 0 on Windows, for example. This is
done as previous usages in php-src were mixed and on many places they
were only checked with ifdef.
2024-07-08 21:25:16 +02:00
Niels Dossche
23391f1fe7 Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:42 +02:00
Niels Dossche
d3992b6d09 Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
2024-07-07 13:18:35 +02:00
Niels Dossche
b44ad27a78 Fix GH-14550: No warning message when Zend DTrace is enabled that opcache.jit is implictly disabled
Closes GH-14847.
2024-07-07 13:18:01 +02:00
Peter Kokot
dc7b67ebc3 Autotools: Sync PHP_ADD_MAKEFILE_FRAGMENT (#14766)
- Macro help text updated for extensions and general usage
- Arguments quoted
- dnl removes redundant newlines in the generated configure script
2024-07-03 13:15:13 +02:00
Niels Dossche
fa5e29f7d0 Remove always-false if check
prop_info is NULL in this branch.
2024-07-02 02:51:18 -07:00
Niels Dossche
00691f4322 Remove always-true if check 2024-07-02 02:51:18 -07:00
Niels Dossche
00b36ce44a Remove always-false opcode check
opcode cannot be ZEND_POST_INC because of the if check above.
2024-07-02 02:51:18 -07:00
Niels Dossche
7407e760f1 Remove duplicated code
The exact same code already exists above this.
2024-07-02 02:51:18 -07:00
Niels Dossche
985e5ffdb0 Remove doubled variable name from assignment 2024-07-02 02:51:18 -07:00
Benjamin Eberlei
72c874691b RFC: Add #[\Deprecated] Attribute (#11293)
see https://wiki.php.net/rfc/deprecated_attribute

Co-authored-by: Tim Düsterhus <tim@tideways-gmbh.com>
Co-authored-by: Ilija Tovilo <ilija.tovilo@me.com>
2024-07-02 09:44:25 +02:00