History log of /PHP-8.1/ext/ffi/ffi.c (Results 1 – 25 of 121)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 04b35a44 28-Oct-2023 sji

Fix segfault caused by weak references to FFI objects (#12488)

Thank you!


# 11d6bea9 20-Jul-2023 Ilija Tovilo

Fix leaking definitions on FFI::cdef()->new()

Previously, FFI_G(symbols) and FFI_G(tags) were never cleaned up when calling
new on an existing object. However, if cdef() is called withou

Fix leaking definitions on FFI::cdef()->new()

Previously, FFI_G(symbols) and FFI_G(tags) were never cleaned up when calling
new on an existing object. However, if cdef() is called without parameters these
globals are NULL and might be created when new() creates new definitions. These
would then be discarded without freeing them.

Closes GH-11751

show more ...


# 1a5fc6e1 13-Feb-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix assertion failure when var_dump'ing void FFI result (#10568)


# 560ca9c7 24-Jan-2023 Niels Dossche <7771979+nielsdos@users.noreply.github.com>

Fix incorrect bitshifting and masking in ffi bitfield (#10403)

When a uint8_t is bitshifted to the left, it is actually promoted to an
int. For the current code this has the effect of a

Fix incorrect bitshifting and masking in ffi bitfield (#10403)

When a uint8_t is bitshifted to the left, it is actually promoted to an
int. For the current code this has the effect of a wrong sign-extension,
and the result will also wrongly become zero when insert_pos >= 32.
Fix this by adding an explicit cast.
Furthermore, the partial prefix byte mask was computed incorrectly: the
byte is already shifted so the mask should not account for the shift.

show more ...


# 18183ff9 11-Aug-2022 Dmitry Stogov

Fix order of checks to throw exception with better message

This clarifies the "->cdata" meaning.


# 3b92a966 25-Jun-2022 Ilija Tovilo

Convert return type of various object handlers from int to zend_result (#8755)


# 413cbdf7 04-Jun-2022 Máté Kocsis

Declare FFI::__BIGGEST_ALIGNMENT__ in stubs as well


# d476da78 04-Jun-2022 Máté Kocsis

Declare ext/ffi constants in stubs (#8695)


Revision tags: php-8.1.7RC1, php-8.1.4RC1, php-8.1.3, php-8.1.2RC1, php-8.1.0, php-7.3.33
# 90b7bde6 03-Nov-2021 Dmitry Stogov

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[

Use more compact representation for packed arrays.

- for packed arrays we store just an array of zvals without keys.
- the elements of packed array are accessible throuf as ht->arPacked[i]
instead of ht->arData[i]
- in addition to general ZEND_HASH_FOREACH_* macros, we introduced similar
familied for packed (ZEND_HASH_PACKED_FORECH_*) and real hashes
(ZEND_HASH_MAP_FOREACH_*)
- introduced an additional family of macros to access elements of array
(packed or real hashes) ZEND_ARRAY_ELEMET_SIZE, ZEND_ARRAY_ELEMET_EX,
ZEND_ARRAY_ELEMET, ZEND_ARRAY_NEXT_ELEMENT, ZEND_ARRAY_PREV_ELEMENT
- zend_hash_minmax() prototype was changed to compare only values

Because of smaller data set, this patch may show performance improvement
on some apps and benchmarks that use packed arrays. (~1% on PHP-Parser)

TODO:
- sapi/phpdbg needs special support for packed arrays (WATCH_ON_BUCKET).
- zend_hash_sort_ex() may require converting packed arrays to hash.

show more ...


Revision tags: php-7.3.32
# 875a43a4 30-Sep-2021 George Peter Banyard

Voidify zend_ffi_zval_to_bit_field()


# 8d930632 30-Sep-2021 George Peter Banyard

Use bool/zend_result instead of int in FFI

Also use == FAILURE instead of != SUCCESS


# 2397e768 24-Apr-2022 Bob Weinand

Fix GH-8433: Assigning function pointers to structs in FFI leaks memory


# 703cac33 10-Jan-2022 Christoph M. Becker

Fix GH-7867: FFI::cast() from pointer to array is broken

Casting from pointer to array is special, so we must not fall back to
the general FFI casting. There is a particular issue regar

Fix GH-7867: FFI::cast() from pointer to array is broken

Casting from pointer to array is special, so we must not fall back to
the general FFI casting. There is a particular issue regarding the
size comparison, namely that the pointer size is always 8 for 64bit
architectures, but the size of an array is determined by its
declaration, so as is casting a pointer to an array with more than 8
elements would fail, but casting to an array with less than 9 elements
succeeds, but the internal pointer would point to some arbitrary
memory.

We fix this by properly supporting the cast. An alternative would be
to deny this kind of cast generally, since it is not necessarily safe.
However, FFI isn't necessarily safe anyway.

We also check pointer/array type compatibility when casting.

Co-authored-by: Dmitry Stogov <dmitry@zend.com>

Closes GH-7876.

show more ...


Revision tags: php-7.3.31, php-7.3.30
# 570d9b63 20-Jul-2021 Joe Watkins

Not serializable flag permeation


# efbdcb8e 14-Jul-2021 Tyson Andre

Rename FFI `getFuncArg*` to `getFuncParameter*`, $arg_index->$index (#7236)

PHP is already already using "Parameter" instead of "Argument" for reflection on types elsewhere.

Paramet

Rename FFI `getFuncArg*` to `getFuncParameter*`, $arg_index->$index (#7236)

PHP is already already using "Parameter" instead of "Argument" for reflection on types elsewhere.

Parameter is used to refer to the function declarations
(AST_PARAM internally in the AST, ReflectionFunctionAbstract->getParameters(),
etc.)
Argument is used to refer to expressions passed to the functions by the caller
(ArgumentCountError, etc.).
(Error messages were also changed in php 8.x to refer to passing too many arguments to a
function)

Other languages use similar definitions,
e.g. https://developer.mozilla.org/en-US/docs/Glossary/Parameter

show more ...


# a2845e32 13-Jul-2021 Dmitry Stogov

FFI::CType reflection API


Revision tags: php-7.3.29
# aff36587 29-Jun-2021 Patrick Allaert

Fixed some spaces used instead of tabs


# 01b3fc03 06-May-2021 KsaR

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as

Update http->https in license (#6945)

1. Update: http://www.php.net/license/3_01.txt to https, as there is anyway server header "Location:" to https.
2. Update few license 3.0 to 3.01 as 3.0 states "php 5.1.1, 4.1.1, and earlier".
3. In some license comments is "at through the world-wide-web" while most is without "at", so deleted.
4. fixed indentation in some files before |

show more ...


Revision tags: php-7.3.28, php-7.3.27, php-7.3.26, php-7.3.26RC1, php-7.3.25, php-7.3.25RC1, php-7.3.24, php-7.3.24RC1
# 5caaf40b 29-Sep-2020 George Peter Banyard

Introduce pseudo-keyword ZEND_FALLTHROUGH

And use it instead of comments


# 465cfc49 18-Mar-2021 Dmitry Stogov

Additional fix for bug #80847.
On x86_64 part of structure may be passed in CPU registers.


# 38ebb55c 17-Mar-2021 Dmitry Stogov

Fixed bug #80847 (CData structs with fields of type struct can't be passed as C function argument)


# 98fb565c 05-Feb-2021 Máté Kocsis

Generate class entries from stubs for another batch of extensions

Closes GH-6669


# 3e01f5af 15-Jan-2021 Nikita Popov

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool

Replace zend_bool uses with bool

We're starting to see a mix between uses of zend_bool and bool.
Replace all usages with the standard bool type everywhere.

Of course, zend_bool is retained as an alias.

show more ...


# 1b2aba28 14-Jan-2021 Nikita Popov

Remove Z_PARAM separate params where they don't make sense

Separation can only possibly make sense for array parameters
(or something that can contain arrays, like zval parameters). It

Remove Z_PARAM separate params where they don't make sense

Separation can only possibly make sense for array parameters
(or something that can contain arrays, like zval parameters). It
never makes sense to separate a bool.

The deref parameters are also of dubious utility, but leaving them
for now.

show more ...


# c1d76617 24-Dec-2020 Máté Kocsis

Add a few other RETURN_THROWS()


12345