Bug #79576 [NEW]: "const TYPE *" is not parsed properly when type is not defined
| From: | grzegorz129 at gmail dot com | Date: | Fri, 08 May 2020 18:52:12 +0000 |
| Subject: | Bug #79576 [NEW]: "const TYPE *" is not parsed properly when type is not defined | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-226967@lists.php.net to get a copy of this message | ||
From: grzegorz129 at gmail dot com
Operating system: macOS 10.15.4
PHP version: 7.4.5
Package: *Extensibility Functions
Bug Type: Bug
Bug description:"const TYPE *" is not parsed properly when type is not defined
Description:
------------
When parsing function declarations containing "const CUSTOM_TYPE *" the
FFI modules wrongly states that unsupported specifier combination was
used. When type is properly defined the FFI module is able to parse them
without a problem.
Test script:
---------------
<?php
//Result: no error
\FFI::cdef('
typedef unsigned long u_long;
typedef u_long oid;
struct tree *get_tree(const oid *, size_t, struct tree *);
');
//vs.
//Result: FFI\ParserException: unsupported type specifier combination at
line 1
\FFI::cdef('struct tree *get_tree(const oid *, size_t, struct tree
*);');
Expected result:
----------------
FFI\ParserException: undefined C type 'oid'
Actual result:
--------------
FFI\ParserException: unsupported type specifier combination
--
Edit bug report at https://bugs.php.net/bug.php?id=79576&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79576&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79576&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79576&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79576&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79576&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79576&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79576&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79576&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79576&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79576&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79576&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79576&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79576&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79576&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79576&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79576&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79576&r=mysqlcfg