Skip to content

Commit e579477

Browse files
committed
ext/ffi: Prevent variable shadowing
1 parent 2ca0c2f commit e579477

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Diff for: ext/ffi/ffi.c

+3-2
Original file line numberDiff line numberDiff line change
@@ -6767,7 +6767,6 @@ void zend_ffi_declare(const char *name, size_t name_len, zend_ffi_dcl *dcl) /* {
67676767
void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl, bool incomplete) /* {{{ */
67686768
{
67696769
zend_ffi_tag *tag;
6770-
zend_ffi_type *type;
67716770

67726771
if (!FFI_G(tags)) {
67736772
FFI_G(tags) = pemalloc(sizeof(HashTable), FFI_G(persistent));
@@ -6810,8 +6809,10 @@ void zend_ffi_declare_tag(const char *name, size_t name_len, zend_ffi_dcl *dcl,
68106809
type->attr &= ~ZEND_FFI_ATTR_INCOMPLETE_TAG;
68116810
}
68126811
} else {
6813-
zend_ffi_tag *tag = pemalloc(sizeof(zend_ffi_tag), FFI_G(persistent));
68146812
zend_string *tag_name = zend_string_init(name, name_len, FFI_G(persistent));
6813+
zend_ffi_type *type;
6814+
6815+
tag = pemalloc(sizeof(zend_ffi_tag), FFI_G(persistent));
68156816

68166817
if (dcl->flags & ZEND_FFI_DCL_STRUCT) {
68176818
tag->kind = ZEND_FFI_TAG_STRUCT;

0 commit comments

Comments
 (0)