mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Fixed incorrect error message
This commit is contained in:
parent
14359eb7eb
commit
2ccc27bcfc
@ -92,7 +92,7 @@ declarations:
|
||||
;
|
||||
|
||||
declaration_specifiers(zend_ffi_dcl *dcl):
|
||||
( ?{sym != YY_ID || zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text)}
|
||||
( ?{sym != YY_ID || !(dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS)}
|
||||
( {if (dcl->flags & ZEND_FFI_DCL_STORAGE_CLASS) yy_error_sym("unexpected", sym);}
|
||||
"typedef"
|
||||
{dcl->flags |= ZEND_FFI_DCL_TYPEDEF;}
|
||||
|
@ -3588,7 +3588,7 @@ static int parse_declaration_specifiers(int sym, zend_ffi_dcl *dcl) {
|
||||
default:
|
||||
yy_error_sym("unexpected", sym);
|
||||
}
|
||||
} while ((YY_IN_SET(sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLINE,YY___INLINE__,YY__NORETURN,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY__ALIGNAS,YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTICT,YY___RESTRICT__,YY_VOLATILE,YY___VOLATILE,YY___VOLATILE__,YY__ATOMIC,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNSIGNED,YY__BOOL,YY__COMPLEX,YY_COMPLEX,YY___COMPLEX,YY___COMPLEX__,YY_STRUCT,YY_UNION,YY_ENUM,YY_ID), "\370\377\371\377\377\037\301\001\000\000\040\000")) && (sym != YY_ID || zend_ffi_is_typedef_name((const char*)yy_text, yy_pos - yy_text)));
|
||||
} while ((YY_IN_SET(sym, (YY_TYPEDEF,YY_EXTERN,YY_STATIC,YY_AUTO,YY_REGISTER,YY_INLINE,YY___INLINE,YY___INLINE__,YY__NORETURN,YY___CDECL,YY___STDCALL,YY___FASTCALL,YY___THISCALL,YY__ALIGNAS,YY___ATTRIBUTE,YY___ATTRIBUTE__,YY___DECLSPEC,YY_CONST,YY___CONST,YY___CONST__,YY_RESTRICT,YY___RESTICT,YY___RESTRICT__,YY_VOLATILE,YY___VOLATILE,YY___VOLATILE__,YY__ATOMIC,YY_VOID,YY_CHAR,YY_SHORT,YY_INT,YY_LONG,YY_FLOAT,YY_DOUBLE,YY_SIGNED,YY_UNSIGNED,YY__BOOL,YY__COMPLEX,YY_COMPLEX,YY___COMPLEX,YY___COMPLEX__,YY_STRUCT,YY_UNION,YY_ENUM,YY_ID), "\370\377\371\377\377\037\301\001\000\000\040\000")) && (sym != YY_ID || !(dcl->flags & ZEND_FFI_DCL_TYPE_SPECIFIERS)));
|
||||
return sym;
|
||||
}
|
||||
|
||||
|
19
ext/ffi/tests/043.phpt
Normal file
19
ext/ffi/tests/043.phpt
Normal file
@ -0,0 +1,19 @@
|
||||
--TEST--
|
||||
FFI 043: Type redeclaration
|
||||
--SKIPIF--
|
||||
<?php require_once('skipif.inc'); ?>
|
||||
--INI--
|
||||
ffi.enable=1
|
||||
--FILE--
|
||||
<?php
|
||||
FFI::cdef("
|
||||
typedef int a;
|
||||
typedef unsigned int a;
|
||||
");
|
||||
?>
|
||||
--EXPECTF--
|
||||
Fatal error: Uncaught FFI\ParserException: redeclaration of 'a' at line 3 in %s043.php:2
|
||||
Stack trace:
|
||||
#0 %s043.php(2): FFI::cdef('%s')
|
||||
#1 {main}
|
||||
thrown in %s043.php on line 2
|
Loading…
Reference in New Issue
Block a user