mirror of
https://github.com/php/php-src.git
synced 2024-12-02 22:34:55 +08:00
703cac33db
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. |
||
---|---|---|
.. | ||
tests | ||
config.m4 | ||
config.w32 | ||
CREDITS | ||
ffi_arginfo.h | ||
ffi_parser.c | ||
ffi.c | ||
ffi.g | ||
ffi.stub.php | ||
php_ffi.h |