Skip to content

Commit 73a3197

Browse files
committed
ext/ffi: Prevent signed to unsigned comparisons
1 parent 6cd3863 commit 73a3197

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ext/ffi/ffi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -929,7 +929,7 @@ static void zend_ffi_callback_hash_dtor(zval *zv) /* {{{ */
929929
if (callback_data->fcc.function_handler->common.fn_flags & ZEND_ACC_CLOSURE) {
930930
OBJ_RELEASE(ZEND_CLOSURE_OBJECT(callback_data->fcc.function_handler));
931931
}
932-
for (int i = 0; i < callback_data->arg_count; ++i) {
932+
for (uint32_t i = 0; i < callback_data->arg_count; ++i) {
933933
if (callback_data->arg_types[i]->type == FFI_TYPE_STRUCT) {
934934
efree(callback_data->arg_types[i]);
935935
}
@@ -974,7 +974,7 @@ static void zend_ffi_callback_trampoline(ffi_cif* cif, void* ret, void** args, v
974974
}
975975

976976
if (callback_data->arg_count) {
977-
int n = 0;
977+
uint32_t n = 0;
978978

979979
for (n = 0; n < callback_data->arg_count; n++) {
980980
zval_ptr_dtor(&fci.params[n]);

0 commit comments

Comments
 (0)