Commit Graph

137935 Commits

Author SHA1 Message Date
Ilija Tovilo
1f35e2a999
Fix uninitialized CG(zend_lineno)
Closes GH-15813
2024-09-09 19:34:05 +02:00
Ilija Tovilo
b9fdc0bdcd
Fix uninitialized EG(user_error_handler_error_reporting)
Closes GH-15812
2024-09-09 19:33:32 +02:00
David CARLIER
b5c378c8d7
[skip ci] Fix GH-15810: Forgotten UPGRADING entry for Pdo_Pgsql::query. (#15811)
ref: GH-12476
2024-09-09 18:10:38 +01:00
Ilija Tovilo
06d02d160d
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix uouv in array_column
2024-09-09 16:58:35 +02:00
Ilija Tovilo
3667e7e34a
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix uouv in array_column
2024-09-09 16:58:28 +02:00
Ilija Tovilo
24a294922b
Fix uouv in array_column
column_long and index_long might not be set, but are still used as arguments.
They are not actually used if column_str is set, but it's better to initialize
them anyway, if only to make MemorySanitizer happy.
2024-09-09 16:55:02 +02:00
Ilija Tovilo
e97cde9f35
Merge branch 'PHP-8.3'
* PHP-8.3:
  Intercept strlcpy and strlcat for msan on Clang 17 (#12674)
2024-09-09 16:46:00 +02:00
Ilija Tovilo
d5359ac7ce
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Intercept strlcpy and strlcat for msan on Clang 17 (#12674)
2024-09-09 16:45:54 +02:00
Ilija Tovilo
99504aa148
Intercept strlcpy and strlcat for msan on Clang 17 (#12674) 2024-09-09 16:45:46 +02:00
Ilija Tovilo
0ff9e16247
[skip ci] Add missing NEWS entry for master 2024-09-09 16:44:11 +02:00
Dmitry Stogov
d670ee7d03
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix OPcache tests under specific conditions
2024-09-09 10:00:47 +03:00
Dmitry Stogov
94f5ef09a0
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix OPcache tests under specific conditions
2024-09-09 10:00:41 +03:00
Go Kudo
d966c296d0
Fix OPcache tests under specific conditions 2024-09-09 10:00:25 +03:00
Dmitry Stogov
d0acf3012e
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix OPcache tests under specific conditions
2024-09-09 09:57:49 +03:00
Dmitry Stogov
fb2266b1ca
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix OPcache tests under specific conditions
2024-09-09 09:56:37 +03:00
Go Kudo
bca5f6e74f
Fix OPcache tests under specific conditions 2024-09-09 09:55:52 +03:00
Dmitry Stogov
4c11168f60
Fix GH-15656: php8.4beta4 JIT erronous results (#15732)
* Improve trace SSA construction and type inference

* Fix incorrect abstract stack maintenance

* Add missing register store

* Avoid IR binding for the dangerous case

* Fix access to possibly uninitilezed variable

* Improve trace SSA construction and type inference

* Fix IR constuction

Force load values into regesters before any branches to guarantee SSA
dominance property
2024-09-09 09:28:57 +03:00
Ilija Tovilo
837a8b60bf
Merge branch 'PHP-8.3'
* PHP-8.3:
  Fix uninitialized lineno in constant AST of internal enums
2024-09-08 23:44:58 +02:00
Ilija Tovilo
e207071129
Merge branch 'PHP-8.2' into PHP-8.3
* PHP-8.2:
  Fix uninitialized lineno in constant AST of internal enums
2024-09-08 23:44:48 +02:00
Ilija Tovilo
08e0729c57
Fix uninitialized lineno in constant AST of internal enums
Closes GH-15806
2024-09-08 23:44:11 +02:00
Peter Kokot
16e218a596
Autotools: Obsolete PHP_TEST_BUILD, PHP_BUILD_THREAD_SAFE, and PHP_DEF_HAVE (#15802)
The PHP_BUILD_THREAD_SAFE macro is a simple wrapper around setting the
enable_zts variable and can't be used in PHP extensions realistically.

The PHP_TEST_BUILD macro might produce warnings on certain compiler
configurations and default AC_* macros like AC_LINK_IFELSE,
AC_CHECK_LIB, or AC_CHECK_FUNC are better suited for such checks. Also,
a quick browse through the open-source PHP extensions doesn't find
usages of this macro except in imap extension where patch is was already
sent:
https://github.com/php/pecl-mail-imap/pull/11

PHP_DEF_HAVE is a wrapper around AC_DEFINE and using AC_DEFINE_UNQUOTED
and AS_TR_CPP are better suited for this task where also help text can
be passed. Usages in the open source PHP extensions have been checked and
patches sent where found.
2024-09-08 21:09:48 +02:00
Peter Kokot
dfdec2d550
Autotools: Refactor PHP_TEST_BUILD checks (#15798)
- The libgd sanity check is there only to check whether all current
  linked libraries for the bundled libgd work together, otherwise it is
  probably even redundant a bit; this refactors it to a simpler
  AC_LINK_IFELSE check with default empty C program by Autoconf
- The IBM DB2 sanity check is simplified with AC_CHECK_FUNC instead
2024-09-08 21:05:30 +02:00
Peter Kokot
b97a60c9a3
Autotools: Check Apache version with apxs and HTTPD_VERSION variable (#15476)
The apxs -q HTTPD_VERSION variable is available since Apache 2.4.17.
This change obsoletes the PHP_AP_EXTRACT_VERSION macro and checks the
version in the config.m4 file directly. Version is checked against the
dotted format instead of the version number.
2024-09-08 20:13:48 +02:00
Christoph M. Becker
edcd6cc564
gai_strerror() is not thread-safe on Windows (GH-15568)
First we refactor to have only a single usage of `PHP_GAI_STRERROR()`
left; then we drop the macro in favor of calling the different
functions conditionally in an ad-hoc style.

This is necessary because the return value of `php_win32_error_to_msg`
needs to be freed by the caller.

The error messages are no more inline with other error messages, since
`gai_strerror()` apparently always appends a period and a space.

We also properly configure IPv4/v6 on Windows.  Since WSPiApi.h has been
created in 2000, so we can safely assume that it is available everywhere
nowadays.  Furthermore, `gai_strerror()` is available regardless of
whether there is IPv6 support.
2024-09-08 16:16:40 +02:00
Christoph M. Becker
50b3a0d011
Add comments about internal headers (GH-15689)
A common convention is to name internal C header files as `*_int.h`.
Since a couple of these are actually installed, we add comments that
this is not supposed to happen, (a) to avoid installing further
internal headers, and (b) to pave the way to fix this in the next major
PHP version.

Somewhat special is php_gmp_int.h, where "int" is meant as abbreviation
for "interface".

Another common convention is appending `_priv` or `_private`, but since
there have not been any issues regarding these headers so far, we
refrain from adding respective comments to these headers.

Anyhow, it might be a good idea to introduce some common naming
convention for such internal/private headers.
2024-09-08 16:11:25 +02:00
Niels Dossche
7771ec07e5
Fix bug #61525: SOAP functions require at least one space after HTTP header colon
HTTP/1.1 does not require a single whitespace after the colon, and
SoapServer does implement HTTP/1.1. The header value is already correctly
whitespace-trimmed, so no behaviour change happens w.r.t. header values.

Closes GH-15793.
2024-09-08 10:42:30 +02:00
Peter Kokot
0f3b2e506b
Autotools: Move extension setup to main check (#15797)
Also, redundant PHP_MBREGEX check is removed and wrapped in a single
"if" check.
2024-09-08 08:31:21 +02:00
Peter Kokot
6d6bf0530a
Autotools: Enable adding a list of paths in PHP_ADD_INCLUDE (#15777)
This enables adding multiple include paths. For example:

    PHP_ADD_INCLUDE([
      $abs_srcdir
      $abs_builddir
      $abs_srcdir/main
      $abs_builddir/main
    ], [1])

The 2nd argument "prepend" is now validated at Autoconf compile time
instead of the configure time.
2024-09-08 06:57:31 +02:00
Peter Kokot
e358634cdc
Sync Zend/*_i386_sysv_elf_gas.S with upstream (#15788)
This is a sync with upstream already fixed in early 2024 which fixes
64-bit builds on 32-bit hosts. PHP's bundled config.guess sets the
host_alias, for example, on Solaris systems to 64-bit if the compiler
supports it even though the architecture is actually 32-bit. These
assembly files resolve this situation in a build-system-agnostic way by
including the architecture file that is supported by the compiler.
2024-09-07 21:27:02 +02:00
Daniel Ruf
dfe6c13850
Fix typo (#15780)
* Fix typo

* Implement conditional message

* Use suggested code with ternary

* Wrap ternary

Co-authored-by: Peter Kokot <peterkokot@gmail.com>

---------

Co-authored-by: Peter Kokot <peterkokot@gmail.com>
2024-09-07 15:25:02 +02:00
Niels Dossche
ac0931d37a Reuse bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
2e88916b58 Move bcmath_check_scale() 2024-09-07 12:26:59 +02:00
Niels Dossche
f1b4e1276c Simplify bcmath_check_scale()
The scale is default-initialized to 0, so we can simplify the code a
bit.
2024-09-07 12:26:59 +02:00
Peter Kokot
94ecc1fe7d
Autotools: Sync CS for PHP_PWRITE_TEST and PHP_PREAD_TEST (#15774)
- AS_* macros used
- Arguments quoted
- Cache variable ac_cv_pread renamed to php_cv_func_pread
- Cache variables ac_cv_pwrite renamed to php_cv_func_pwrite
2024-09-07 11:53:35 +02:00
Peter Kokot
de48b90d61
Convert CRLF line endings to LF (#15767)
This patch simplifies line endings tracked in the Git repository and
syncs them to the LF style instead of the CRLF.

Newline characters:
- LF (\n) (*nix and Mac)
- CRLF (\r\n) (Windows)
- CR (\r) (old Mac, obsolete)

To see which line endings are in the index and in the working copy the
following command can be used:
`git ls-files --eol`

Git also provides `.gitattributes` file to specify files that need
specific line endings in the working directory on all platforms (either
CRLF or LF):

```
file-with-crlf text eol=crlf
```

Changed files shouldn't cause issues on modern Windows platforms because
also Git can do output conversion if core.autocrlf=true is set on
Windows and use CRLF newlines in all files in the working tree.

Unless CRLF files are tracked specifically, Git by default tracks all
files in the index using LF newlines.
2024-09-07 11:03:32 +02:00
Peter Kokot
5ea6b044cd
Autotools: Fix gd extension -I flag for bundled libgd (#15786)
The ext_srcdir variable is at time of writing set only after calling the
PHP_NEW_EXTENSION. Other extensions also use @ext_srcdir@ template
placeholder for these cases. This fixes wrongly set include flag even
though build also works without libgd include flag.
2024-09-07 09:46:06 +02:00
DanielEScherzer
4a4574290f
[skip ci] docs: fix constant syntax in stubs.rst (#15785)
Constants are declared with `=` not `:`
2024-09-07 08:22:10 +01:00
DanielEScherzer
047f0c9657
userland_declaration_error_class_const.phpt: fix test name (#15784)
Unlike the `userland_declaration_error_const.phpt` test, the point of this test
is to demonstrate using a class constant as the default parameter. See also the
corresponding internal_declaration_* tests.

[skip ci]
2024-09-07 07:37:05 +02:00
Peter Kokot
56400f709b
Autotools: s/M4 macros/Autoconf macros (#15778)
M4 macros would mean macros for M4 language like m4_normalize() and
similar. Macros defined with AC_DEFUN are better called simply Auotoconf
macros.

[skip ci]
2024-09-07 05:53:00 +02:00
Bob Weinand
25d761623c
Make internal run_time_cache a persistent allocation (#15040)
We also add zend_map_ptr_static, so that we do not incur the overhead of constantly recreating the internal run_time_cache pointers on each request.
This mechanism might be extended for mutable_data of internal classes too.
2024-09-07 01:45:26 +02:00
Derick Rethans
2f3224ea41
Updated to version 2024.2 (2024b) 2024-09-06 12:33:39 +01:00
Derick Rethans
8fcd0ccecf
Empty merge 2024-09-06 12:33:38 +01:00
Derick Rethans
7023fb9d93
Updated to version 2024.2 (2024b) 2024-09-06 12:33:37 +01:00
Derick Rethans
d31a9474b0
Empty merge 2024-09-06 12:33:37 +01:00
Derick Rethans
5fc37b1ec6
Updated to version 2024.2 (2024b) 2024-09-06 12:33:36 +01:00
Peter Kokot
e0e6d326e2
Autotools: Sync CS in PHP_PROG_AWK (#15772)
- AS_* macros used
2024-09-06 12:10:50 +02:00
Peter Kokot
418329226a
Autotools: Sync CS in php.m4 (#15771)
- AS_* macros used
2024-09-06 09:31:52 +02:00
Peter Kokot
bcbf7bea92
Autotools: Replace uname with host_alias for finding Solaris (#15770)
This wraps checks in AC_CACHE_CHECK and replaces the "uname -sr" command
with simpler $host_alias as it is already set by the config.guess script
properly.
2024-09-06 08:44:10 +02:00
Peter Kokot
824f55ae84
Sync Zend/asm/make_ppc64_sysv_macho_gas.S with upstream (#15769)
There was a typo in make_ppc64_sysv_macho_gas.S with missing closing
multi-line comment. Upstream fixed it in ~2023:
https://github.com/boostorg/context/
2024-09-06 08:42:44 +02:00
Peter Kokot
aebe63dd0f
Autotools: Sync CS for PHP_RUNPATH_SWITCH (#15768)
- AS_VAR_IF macros used
- AC_CACHE_VAL and AC_MSG_CHECKING replaced with AC_CACHE_CHECK
- arguments quoted
2024-09-06 08:41:09 +02:00