1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Commit Graph

140051 Commits

Author SHA1 Message Date
Gina Peter Banyard
b7169a2248 ext/soap: Don't call readfile() userland function (#17432)
* ext/soap: Add some SoapServer tests

* ext/soap: Don't call readfile() userland function

We can perform the operation directly, moreover there is no risk of a user disabling the readfile function and defining their own messing up what we are doing.

* ext/soap: Actually throw a SOAP Fault if the WSDL has disappeared
2025-01-15 14:37:44 +00:00
Christoph M. Becker
7512685767 Use built-ins for addition and subtraction on Windows (GH-17472)
For Clang, we just need to define the respective macros, since these
built-ins are available in all supported Clang versions (>= 4.0.0,
currently)[1].

For MSVC (and possibly other compilers) we use the respective APIs of
intsafe.h[2] which are available as of Windows 7/Server 2008 R2.

This avoids the UB due to signed integer overflow that may happen with
our fallback implementations.

We also drop the superfluous SHORT_MAX definition from pdo_firebird.
This shouldn't be defined unconditionally, but since it is apparently
unused, we remove it altogether.

[1] <https://releases.llvm.org/4.0.0/tools/clang/docs/LanguageExtensions.html>
[2] <https://learn.microsoft.com/en-us/windows/win32/api/intsafe/>
2025-01-15 12:58:12 +01:00
Gina Peter Banyard
abfa377fae ext/pdo: Add FETCH_INTO setting via setAttribute "hack" 2025-01-15 03:02:30 +00:00
Gina Peter Banyard
dfcac15739 ext/pdo: Rename variable, because i is really not descriptive 2025-01-15 03:02:30 +00:00
Dmitry Stogov
4c84ed4d98 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-15 02:46:08 +03:00
Dmitry Stogov
9aaa469f99 Update IR
IR commit: d6d7fc489137aab218b04b59d770b497c5ae3832
2025-01-15 02:45:24 +03:00
Niels Dossche
650e59a1c2 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
2025-01-14 22:38:18 +01:00
Niels Dossche
3524702fe1 Fix GH-17428: Assertion failure ext/opcache/jit/zend_jit_ir.c:8940
The code to update the call_level in that case skips the opline itself,
as that's handled by the tail handler, and then wants to set the opline
to the last opline of the block because the code below the switch will
update the call_level for that opline.
However, the test has a block with a single opline (THROW). The block
after that has ZEND_INIT_FCALL, because `i` points to ZEND_INIT_FCALL
now, it erroneously causes the call_level after the switch.

Closes GH-17438.
2025-01-14 22:37:41 +01:00
David Carlier
a4e25839d3 Merge branch 'PHP-8.4' 2025-01-14 18:33:00 +00:00
David Carlier
b1e0176455 Merge branch 'PHP-8.3' into PHP-8.4 2025-01-14 18:32:51 +00:00
David Carlier
e4473abefc Fix GH-17463: SplTempFileObject::ftruncate() segfault on negative length.
close GH-465
2025-01-14 18:32:01 +00:00
Ilija Tovilo
e95b298262 Store prop info name in CG(context) instead of prop info
The prop info is not always available, e.g. when compiling the default
value.

See GH-17378
Closes GH-17464
2025-01-14 17:01:10 +01:00
Christoph M. Becker
634edc8ab3 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix clang compiler detection on Windows
2025-01-14 12:36:58 +01:00
Christoph M. Becker
58628e0cc6 Fix clang compiler detection on Windows
A previous commit[1] left a "debug" statement, which causes clang
builds on Windows to fail always.

[1] <b3d6414b87>

Closes GH-17450.
2025-01-14 12:36:19 +01:00
Ilija Tovilo
0e1fbf97f4 Merge branch 'PHP-8.4'
* PHP-8.4:
  Relax final+private warning for trait methods with inherited final
2025-01-13 16:46:54 +01:00
Ilija Tovilo
3c138641e1 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Relax final+private warning for trait methods with inherited final
2025-01-13 16:46:43 +01:00
Ilija Tovilo
a6a290d541 Relax final+private warning for trait methods with inherited final
Fixes GH-17214
Closes GH-17381
2025-01-13 16:46:01 +01:00
Ilija Tovilo
a06668af30 Merge branch 'PHP-8.4'
* PHP-8.4:
  __PROPERTY__ does not work in all constant expression contexts
2025-01-13 16:43:32 +01:00
Ilija Tovilo
147e9c808c __PROPERTY__ does not work in all constant expression contexts
Fixes GH-17222
Closes GH-17378
2025-01-13 16:42:38 +01:00
Gina Peter Banyard
af1e289332 ext/json: Refactor php_json_encode_serializable_object() to call method directly 2025-01-13 13:46:25 +00:00
Gina Peter Banyard
75a15cf640 ext/json: Use zend_result type instead of int 2025-01-13 13:46:25 +00:00
Christoph M. Becker
aac71904ca Don't pass -fwrapv to clang on Windows (GH-17458)
This is apparently not supported there; the VS supplied clang version
18.1.8, reports:

`clang-cl: warning: unknown argument ignored in clang-cl: '-fwrapv' [-Wunknown-argument]`
2025-01-13 14:10:23 +01:00
Christoph M. Becker
788128aec7 Fix -Wpointer-type-mismatch warning (GH-17453)
`GetProcAddress()` returns a `FARPROC` (aka. `long long (*)()`) which
is not compatible with `void *` per the specs.  However, on Windows
they are, so we silence the warning with a cast.
2025-01-13 13:04:19 +01:00
Christoph M. Becker
1675d32261 Fix printf style issues in Windows specific code (GH-17452)
A couple of calls pass strings as formats (`-Wformat-security`), and
some others mix up types (`-Wformat`).
2025-01-13 11:50:05 +01:00
Christoph M. Becker
26bf239e6d Resolve -Wincompatible-pointer-types warnings (GH-17456)
The phpdbg issue is a real issue, although it's unlikely that harm can
be done due to stack alignment and little-endianess.  The others seem
to be more cosmetic.
2025-01-13 10:54:13 +01:00
Niels Dossche
f99d62013b Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17139: Fix zip_entry_name() crash on invalid entry
2025-01-12 20:42:59 +01:00
Niels Dossche
fd0cabbbe4 Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17139: Fix zip_entry_name() crash on invalid entry
2025-01-12 20:42:53 +01:00
Niels Dossche
d08a9e0010 Fix GH-17139: Fix zip_entry_name() crash on invalid entry
Don't increment the refcount, but latter remember the ID to check
afterwards whether the resource still exists.

Replaces GH-17142.
Closes GH-17439.
2025-01-12 20:37:51 +01:00
Christoph M. Becker
c264679fb4 Remove braces around string initializers (#GH-17451)
While MSVC is apparently fine with that, Clang complains about it (`-Wbraced-scalar-init`).
2025-01-12 19:40:15 +01:00
Niels Dossche
e6f42c1ed0 Fix incorrect casts 2025-01-11 10:50:07 +01:00
Gina Peter Banyard
11937b3df7 ext/pdo: Add a test for PDO::FETCH_FUNC with a return by-ref callback (#17425) 2025-01-10 17:27:19 +00:00
Niels Dossche
bdcb3e9e69 Merge branch 'PHP-8.4'
* PHP-8.4:
  Backport fix GH-17307
2025-01-10 18:24:57 +01:00
Niels Dossche
27fbdc16ff Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Backport fix GH-17307
2025-01-10 18:24:51 +01:00
Niels Dossche
e8fce295bc Backport fix GH-17307
This is a backport of GH-17319 to fix GH-17307 on lower branches.

Closes GH-17424.
2025-01-10 18:24:25 +01:00
Calvin Buckley
97a26ae97a Update OpenBSD glob implementation for Windows (#16948)
We're considering making this used as a glob implementation on POSIX as
well, but first, we should rebase it from the latest version of OpenBSD.

This also adds a new internal header (charclass.h) for glob.

See conversation in GH-15564.

Co-authored-by: Christoph M. Becker <cmbecker69@gmx.de>
2025-01-10 11:47:28 -04:00
Tim Düsterhus
d8d1cb4195 zend_ast: Print placeholder value when printing ZEND_AST_OP_ARRAY (#17405)
As per the discussion in GH-17120, we are printing a placeholder value only.
The commit history of that PR also includes alternative implementations, should
a different decision be desirable.

Fixes GH-17096
Closes GH-17120
2025-01-10 08:37:17 +01:00
Gina Peter Banyard
8d79ed6b3e ext/pdo: Refactor PDO::FETCH_FUNC to not rely on an FCI on the struct (#17420) 2025-01-09 22:22:52 +00:00
Dmitry Stogov
2d4155a6a9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Update IR
2025-01-10 00:35:33 +03:00
Dmitry Stogov
4763193567 Update IR
IR commit: e445f57f3a936584db28489a49098d52f03388a7
2025-01-10 00:34:58 +03:00
Niels Dossche
8c443016e9 Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17307: Internal closure causes JIT failure
  Generate inline frameless icall handlers only if the optimization level is set to inline
  Fix GH-15981: Segfault with frameless jumps and minimal JIT
  Fix GH-15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
2025-01-09 20:01:16 +01:00
Niels Dossche
28b448ac20 Fix GH-17307: Internal closure causes JIT failure
`bcadd(...)` is a closure for an internal function, and
`zend_jit_push_call_frame` takes into account both last_var and the
difference in argument numbers not only for user code but also for
internal code. However, this is inconsistent with
`zend_vm_calc_used_stack`, causing argument corruption.
Making this consistent fixes the issue.

I could only reproduce the assertion failure when using Valgrind.

Closes GH-17319.
2025-01-09 19:59:38 +01:00
Niels Dossche
c790c5b2e7 Generate inline frameless icall handlers only if the optimization level is set to inline 2025-01-09 19:59:10 +01:00
Niels Dossche
72184abd2f Fix GH-15981: Segfault with frameless jumps and minimal JIT
Minimal JIT shouldn't generate a call to the complex handler, but
instead rely on the VM and then check for a two-way jump.
This moves the frameless codegen under the check `JIT_G(opt_level) >=
ZEND_JIT_LEVEL_INLINE`.
2025-01-09 19:59:03 +01:00
Niels Dossche
b666dc9788 Fix GH-15833: Segmentation fault (access null pointer) in ext/spl/spl_array.c
We're accessing the object properties table directly in spl, but we're
not accounting for lazy objects. Upon accessing we should trigger the
initialization as spl is doing direct manipulations on the object
property table and expects a real object.

Closes GH-17235.
2025-01-09 19:58:00 +01:00
Niels Dossche
5d4707e22a Merge branch 'PHP-8.4'
* PHP-8.4:
  Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
  NEWS
  Add comment
  Fix GH-16892: ini_parse_quantity() fails to parse inputs starting with 0x0b
  Fix GH-16886: ini_parse_quantity() fails to emit warning for 0x+0
  Merge duplicate code blocks
2025-01-09 19:54:52 +01:00
Niels Dossche
3eb79e146f Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3:
  Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
  NEWS
  Add comment
  Fix GH-16892: ini_parse_quantity() fails to parse inputs starting with 0x0b
  Fix GH-16886: ini_parse_quantity() fails to emit warning for 0x+0
  Merge duplicate code blocks
2025-01-09 19:54:46 +01:00
Niels Dossche
a2a7287b87 Fix GH-17409: Assertion failure Zend/zend_hash.c:1730
The array merging function may still hold the properties array while the
object is already being destroyed. Therefore, we should take into
account the refcount in simplexml's destruction code.
It may be possible to trigger this in other ways too.

Closes GH-17421.
2025-01-09 19:53:54 +01:00
Niels Dossche
bf4a776ee7 NEWS 2025-01-09 19:53:23 +01:00
Niels Dossche
a2b8204880 Add comment
Closes GH-17274.
2025-01-09 19:52:13 +01:00
Niels Dossche
7626e88de7 Fix GH-16892: ini_parse_quantity() fails to parse inputs starting with 0x0b 2025-01-09 19:51:18 +01:00