mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Merge branch 'PHP-7.4'
This commit is contained in:
commit
293313cc48
@ -1,7 +1,14 @@
|
||||
--TEST--
|
||||
Bug #77632 (FFI Segfaults When Called With Variadics)
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
try {
|
||||
$libc = FFI::cdef("int printf(const char *format, ...);", "libc.so.6");
|
||||
} catch (Throwable $_) {
|
||||
die('skip libc.so.6 not available');
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
ffi.enable=1
|
||||
--FILE--
|
||||
|
24
ext/ffi/tests/bug77632b.phpt
Normal file
24
ext/ffi/tests/bug77632b.phpt
Normal file
@ -0,0 +1,24 @@
|
||||
--TEST--
|
||||
Bug #77632 (FFI function pointers with variadics)
|
||||
--SKIPIF--
|
||||
<?php
|
||||
require_once('skipif.inc');
|
||||
try {
|
||||
FFI::cdef("extern void *zend_printf;");
|
||||
} catch (Throwable $_) {
|
||||
die('skip PHP symbols not available');
|
||||
}
|
||||
?>
|
||||
--INI--
|
||||
ffi.enable=1
|
||||
--FILE--
|
||||
<?php
|
||||
$libc = FFI::cdef("extern size_t (*zend_printf)(const char *format, ...);");
|
||||
$args = ["test from zend_printf\n"];
|
||||
($libc->zend_printf)(...$args);
|
||||
$args2 = ["Hello, %s from zend_printf\n", "world"];
|
||||
($libc->zend_printf)(...$args2);
|
||||
?>
|
||||
--EXPECT--
|
||||
test from zend_printf
|
||||
Hello, world from zend_printf
|
Loading…
Reference in New Issue
Block a user