Daniel Scherzer
4af64fdbfa
gen_stub: convert parseFramelessFunctionInfo() to a constructor
...
Also mark `FramelessFunctionInfo::$arity` readonly
2025-02-14 08:43:00 +01:00
Daniel Scherzer
9da6050e08
gen_stub: add visibility to class constants
...
Make everything public for now
2025-02-14 08:43:00 +01:00
Daniel Scherzer
eafddfd3d9
gen_stub: document more readonly class properties
2025-02-14 08:43:00 +01:00
Daniel Scherzer
97cd9fdc13
gen_stub: combine identical condition blocks
2025-02-14 08:43:00 +01:00
Daniel Scherzer
12c89aa853
gen_stub: merge ConstOrClassConstName interface into AbstractConstName
...
Interface is only directly implemented by the abstract class, no need to have a
separate interface.
2025-02-14 08:43:00 +01:00
DanielEScherzer
f5c9f8bcd3
gen_stub: fix PropertyInfo::getString() version compatibility ( #17779 )
...
I forgot a `$this->` in #15751
2025-02-14 08:30:28 +01:00
Niels Dossche
78d934ad8e
Merge branch 'PHP-8.4'
...
* PHP-8.4:
Fix memory leak when encoding check fails
2025-02-13 19:11:08 +01:00
Niels Dossche
902e01f4f9
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix memory leak when encoding check fails
2025-02-13 19:10:46 +01:00
ndossche
a54af45a41
Fix memory leak when encoding check fails
...
zlib_create_dictionary_string() allocates memory, so we can leak memory
if there's an early exit before the assignment to the return value.
Solve this by moving all validation upwards.
Closes GH-17788.
2025-02-13 19:10:17 +01:00
Tim Düsterhus
55994f83e0
php_gdb: Fix missing casts in ZendAstPrettyPrinter ( #17786 )
...
Fixes php/php-src#17782
2025-02-13 17:19:47 +01:00
DanielEScherzer
6e3185049a
gen_stub: set up PHP 8.5 support ( #17780 )
...
Add the new known strings from #17755
2025-02-13 16:18:58 +00:00
DanielEScherzer
c3b4359873
[skip ci] run-tests.php: fix some typos ( #17783 )
2025-02-13 16:18:09 +00:00
DanielEScherzer
a81649f992
Zend/tests: organize some tests with sub directories (4) ( #17778 )
...
First pass at moving `Zend/tests/gh*` tests to existing sub directories
Work towards GH-15631
2025-02-13 16:17:36 +00:00
Gina Peter Banyard
65d433161a
Use new known "self" and "parent" zend_strings ( #17766 )
2025-02-12 15:30:55 +00:00
nzsys
48866b760f
[skip ci] Fix typo in PHPDoc: corrected $attribute to $attributes to ( #17774 )
2025-02-12 15:26:23 +00:00
Niels Dossche
5acff0e61d
Update NEWS and UPGRADING for zlib flock() support
...
[ci skip]
Closes GH-17752.
2025-02-11 21:58:05 +01:00
Niels Dossche
4d3d0aeb66
Add test for mandatory zlib locks
...
Windows has mandatory locks, so we can test the exclusive lock reliably.
2025-02-11 21:56:48 +01:00
Niels Dossche
acb17fb450
Add missing error reporting to reading/writing zlib streams
2025-02-11 21:56:41 +01:00
Niels Dossche
6c706c5714
Implement GH-17668: zlib streams should support locking
2025-02-11 21:56:41 +01:00
Niels Dossche
34e1c590cb
Merge branch 'PHP-8.4'
...
* PHP-8.4:
Fix GH-17747: Exception on reading property in register-based FETCH_OBJ_R breaks JIT
Fix GH-17745: zlib extension incorrectly handles object arguments
2025-02-11 21:55:51 +01:00
Niels Dossche
34d8befe8d
Fix GH-17747: Exception on reading property in register-based FETCH_OBJ_R breaks JIT
...
When read_property fails, it may return `&EG(uninitialized_zval)`, and
the exception is handled in the VM. The VM will try to
`zval_ptr_dtor_nogc` the result, but the result was never set, resulting
in dtor'ing garbage data. To solve this, we check when a different zval*
was returned and initialize the result with UNDEF. We don't need to copy
as the slow_ex handler return values are used directly in a register.
Closes GH-17749.
2025-02-11 21:55:23 +01:00
Niels Dossche
0e0d2d21b7
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Fix GH-17745: zlib extension incorrectly handles object arguments
2025-02-11 21:53:52 +01:00
Niels Dossche
4b5c29ef50
Fix GH-17745: zlib extension incorrectly handles object arguments
...
Because of the "H" modifier in ZPP, there are two bugs:
1) The stub is wrong and will cause a crash in debug mode.
2) Non-dynamic properties are not read correctly because they are not
DEINDIRECTed.
Closes GH-17750.
2025-02-11 21:52:53 +01:00
Gina Peter Banyard
ac52b5b738
Zend: Add const specifier to resolve_class_name()
2025-02-11 19:48:05 +00:00
Gina Peter Banyard
8ebf986587
Zend: Add tests for relative types ( #17764 )
2025-02-11 15:18:04 +00:00
Gina Peter Banyard
1ad7743133
Zend: Resolve self and parent types at compile time ( #17755 )
...
This does not apply to traits.
2025-02-11 15:15:32 +00:00
Gina Peter Banyard
15d7b83ad3
ext/pdo: Improve test so that output is decipherable ( #17394 )
2025-02-11 13:30:35 +00:00
David Carlier
ddd1dd0c4b
ext/sockets: adding BSD IP_BINDANY constant.
...
Simply allows the socket to bind to any address, including one not
bound to any network interface.
close GH-17591
2025-02-11 13:10:42 +00:00
Christoph M. Becker
e4999275c2
Fix GH-17658: COMPersistHelper::LoadFromStream() can segfault (GH-17659)
...
* Fix GH-17658: COMPersistHelper::LoadFromStream() can segfault
The actual fix is trivial, but to be able to test the behavior we have
to introduce an own COM object, since existing persistable objects
likely implement `IPersistInit`, not only `IPersist`. We also want to
avoid further test dependencies on possibly unavailable objects, such
as `Word.Application`.
To this purposes, we add a small COM in-process server, which may be
extended for other testing purposes. We keep it simple by implementing
it in C++, but without using any more sophisticated frameworks like ATL.
This component needs to be built explicitly (`nmake comtest.dll`), and
also needs to be explicitly registered (`nmake register_comtest`).
When no longer needed, it is possible to unregister the component
(`nmake unregister_comtest`).
2025-02-11 12:42:25 +01:00
Christoph M. Becker
e6c570a22f
Prevent unsigned overflow in php_handle_swc() (GH-17678)
...
The multiplication of `ZSTR_LEN(bufz)` with the `factor` can easily
overflow on LLP64 architectures, causing a smaller `buf` to be
allocated than expected. While there are no security implications,
calling `uncompress()` with the small buffer cannot be successful
(`Z_BUF_ERROR`). We avoid such superfluous calls by bailing out of
the loop early in case of an overflow condition.
Note that `safe_emalloc()` would not help here, since that will not
prevent 32bit unsigned overflow on 64bit architectures.
2025-02-11 00:47:55 +01:00
Christoph M. Becker
650086f3e6
Exclude unused functions from compilation units (GH-17686)
...
This avoids Clang complaining with `-Wunused-function`.
We also introduce the macro `PRELOAD_SUPPORT` for clarification.
2025-02-10 18:00:19 +01:00
Dmitry Stogov
6deaaf609f
Merge branch 'PHP-8.4'
...
* PHP-8.4:
Update IR
2025-02-10 16:48:11 +03:00
Dmitry Stogov
9fb355b863
Update IR
...
IR commit: 8ec4979470fe2a123d0e56da92aa8d5d19b6e54c
2025-02-10 16:47:47 +03:00
Niels Dossche
2acda557cd
Pack _php_sqlite3_db_object
2025-02-10 08:42:11 +01:00
Niels Dossche
9ee08999f4
Convert initialised to bool
2025-02-10 08:42:11 +01:00
Niels Dossche
dbf7d4402c
Convert is_prepared_statement to bool
2025-02-10 08:42:11 +01:00
Niels Dossche
e14f9f4c42
Pack _php_sqlite3_result_object
2025-02-10 08:42:11 +01:00
Niels Dossche
5eae6d1405
Don't store the object zval directly
2025-02-10 08:42:11 +01:00
Niels Dossche
c0d910d506
Get rid of always-false intern checks
...
These checks are always false because we're receiving a valid
zend_object.
2025-02-10 08:42:11 +01:00
Niels Dossche
bc74cff479
Get rid of unnecessary wrapping a statement in a free list object
...
This simplifies the code and reduces memory usage.
2025-02-10 08:42:11 +01:00
Niels Dossche
43ac692a09
Use faster string operations in sqlite3
2025-02-10 08:42:11 +01:00
DanielEScherzer
bce1f4aeb1
Zend/tests: organize some tests with sub directories (3) ( #16444 )
...
First pass at moving `Zend/tests/bug*` tests to existing sub directories
Work towards GH-15631
2025-02-10 00:35:51 +00:00
Niels Dossche
7b13105120
Merge branch 'PHP-8.4'
...
* PHP-8.4:
Add .gitignore section for additional test build files
2025-02-09 23:25:38 +01:00
Niels Dossche
466d2c1797
Merge branch 'PHP-8.3' into PHP-8.4
...
* PHP-8.3:
Add .gitignore section for additional test build files
2025-02-09 23:25:31 +01:00
Niels Dossche
6ea1c7cb5b
Add .gitignore section for additional test build files
...
[ci skip]
For now this is only for the bad_cmd.exe, but we may add more entries.
Closes GH-17753.
2025-02-09 23:25:17 +01:00
Gina Peter Banyard
b757fa812d
ext/pdo_{odbc|pgsql}: Use precomputed data_source_len ( #17744 )
...
This is already computed by PDO, no need to recompute it again inside the drivers.
2025-02-09 13:10:20 +00:00
Gina Peter Banyard
4e55889dca
ext/pdo: Refactor validation of fetch mode in PDO statement ( #17699 )
...
Co-authored-by: Niels Dossche <7771979+nielsdos@users.noreply.github.com >
2025-02-09 00:35:33 +00:00
Gina Peter Banyard
1331a61100
ext/pdo: Use zend_strpprintf() instead of spprintf() ( #17743 )
...
Most of the time this will end up as a zend_string in some way anyway, do it directly.
2025-02-08 21:19:46 +00:00
Gina Peter Banyard
5333afa607
ext/pdo: Convert _pdo_dbh_t query_stmt_zval to a zend_object pointer ( #17742 )
...
This saves 8 bytes
2025-02-08 19:27:51 +00:00
Jakub Zelenka
bff0ec82a6
Merge branch 'PHP-8.4'
2025-02-08 12:08:19 +01:00