Fix non-variadic CIF initialization for Apple/ARM64
Turns out `aarch64_nfixedargs` wasn't initialized in the non-variadic case, resulting in undefined behavior when allocating arguments.
This commit is contained in:
committed by
Ole André Vadla Ravnås
parent
1cee07be47
commit
0f4e09d27d
@@ -779,6 +779,8 @@ ffi_prep_cif_machdep (ffi_cif *cif)
|
||||
}
|
||||
}
|
||||
|
||||
cif->aarch64_nfixedargs = 0;
|
||||
|
||||
return FFI_OK;
|
||||
}
|
||||
|
||||
@@ -789,9 +791,13 @@ ffi_status ffi_prep_cif_machdep_var(ffi_cif *cif,
|
||||
unsigned int nfixedargs,
|
||||
unsigned int ntotalargs)
|
||||
{
|
||||
ffi_status status;
|
||||
|
||||
status = ffi_prep_cif_machdep (cif);
|
||||
|
||||
cif->aarch64_nfixedargs = nfixedargs;
|
||||
|
||||
return ffi_prep_cif_machdep(cif);
|
||||
return status;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user