1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 10:16:41 +02:00
Files
archived-php-src/ext/ffi/tests/bug79576.phpt
T
Ilija Tovilo 50f58c8923 Add ASAN XLEAK support
Only disable LSAN instead of skipping the test. This way we can still detect
memory issues which is arguably more important anyway.

Closes GH-10996
2023-04-03 08:02:19 +02:00

37 lines
955 B
PHP

--TEST--
Bug #79576 ("TYPE *" shows unhelpful message when type is not defined)
--EXTENSIONS--
ffi
--SKIPIF--
<?php
if (PHP_DEBUG || getenv('SKIP_ASAN')) echo "xleak FFI cleanup after parser error is nor implemented";
?>
--FILE--
<?php
try {
FFI::cdef('struct tree *get_tree(const oid *, size_t, struct tree *);');
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
try {
FFI::cdef('struct tree *get_tree(oid, size_t, struct tree *);');
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
try {
FFI::cdef('
typedef struct _simple_struct {
const some_not_declared_type **property;
} simple_struct;
');
} catch (Throwable $e) {
echo get_class($e) . ": " . $e->getMessage()."\n";
}
?>
DONE
--EXPECT--
FFI\ParserException: Undefined C type "oid" at line 1
FFI\ParserException: Undefined C type "oid" at line 1
FFI\ParserException: Undefined C type "some_not_declared_type" at line 3
DONE