File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed
Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change 22GH-14286 (ffi enum type (when enum has no name) make memory leak)
33--EXTENSIONS--
44ffi
5- --SKIPIF--
6- <?php
7- if (PHP_DEBUG || getenv ('SKIP_ASAN ' )) die ("xfail: FFI cleanup after parser error is not implemented " );
8- ?>
95--INI--
106ffi.enable=1
117--FILE--
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-18629 (FFI::cdef() leaks on function resolution failure)
3+ --EXTENSIONS--
4+ ffi
5+ --INI--
6+ ffi.enable=1
7+ --FILE--
8+ <?php
9+ try {
10+ $ ffi = FFI ::cdef ("void nonexistent_ffi_test_func(void); " );
11+ } catch (\FFI \Exception $ e ) {
12+ echo $ e ->getMessage () . "\n" ;
13+ }
14+ ?>
15+ --EXPECT--
16+ Failed resolving C function 'nonexistent_ffi_test_func'
Original file line number Diff line number Diff line change 1+ --TEST--
2+ GH-18629 (Read field of non C struct/union)
3+ --EXTENSIONS--
4+ ffi
5+ --INI--
6+ ffi.enable=1
7+ --FILE--
8+ <?php
9+ $ x = FFI ::cdef ()->new ("int* " );
10+ try {
11+ $ y = $ x ->foo ;
12+ } catch (\FFI \Exception $ e ) {
13+ echo $ e ->getMessage () . "\n" ;
14+ }
15+ ?>
16+ --EXPECT--
17+ Attempt to read field 'foo' of non C struct/union
You can’t perform that action at this time.
0 commit comments