-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed bug #79576 ("TYPE *" shows unhelpful message when type is not d…
…efined)
- Loading branch information
Showing
4 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--TEST-- | ||
Bug #79576 ("TYPE *" shows unhelpful message when type is not defined) | ||
--SKIPIF-- | ||
<?php | ||
if (!extension_loaded('ffi')) die('skip ffi extension not available'); | ||
if (PHP_DEBUG || getenv('SKIP_ASAN')) echo "xfail: 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 |