1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 16:22:37 +01:00
Files
Niels Dossche 99a14b805e Fix GH-16013 and bug #80857: Big endian issues
The FFI call return values follow widening rules.
We must widen to `ffi_arg` in the case we're handling a return value for types shorter than the machine width.
From http://www.chiark.greenend.org.uk/doc/libffi-dev/html/The-Closure-API.html:
> In most cases, ret points to an object of exactly the size of the type specified when cif was constructed.
> However, integral types narrower than the system register size are widened.
> In these cases your program may assume that ret points to an ffi_arg object.

If we don't do this, we get wrong values when reading the return values.

Closes GH-17255.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>
2024-12-25 21:33:14 +01:00
..
2022-11-03 14:40:35 +01:00
2021-07-13 09:22:31 +02:00
2021-07-13 09:22:31 +02:00
2023-04-03 08:02:19 +02:00
2020-03-18 16:53:06 +01:00
2020-03-18 16:53:06 +01:00
2023-10-28 16:28:43 +02:00
2023-10-28 16:28:43 +02:00
2023-10-28 16:28:43 +02:00