x86: Handle void arguments as if an empty structure
Since libffi currently doesn't allow empty structures, libgo currently maps them to ffi_type_void. Given that we'll abort on this case, handle it gracefully.
This commit is contained in:
@@ -233,6 +233,7 @@ classify_argument (ffi_type *type, enum x86_64_reg_class classes[],
|
|||||||
signalize memory class, so handle it as special case. */
|
signalize memory class, so handle it as special case. */
|
||||||
if (!words)
|
if (!words)
|
||||||
{
|
{
|
||||||
|
case FFI_TYPE_VOID:
|
||||||
classes[0] = X86_64_NO_CLASS;
|
classes[0] = X86_64_NO_CLASS;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@@ -611,6 +612,9 @@ ffi_call_int (ffi_cif *cif, void (*fn)(void), void *rvalue,
|
|||||||
{
|
{
|
||||||
switch (classes[j])
|
switch (classes[j])
|
||||||
{
|
{
|
||||||
|
case X86_64_NO_CLASS:
|
||||||
|
case X86_64_SSEUP_CLASS:
|
||||||
|
break;
|
||||||
case X86_64_INTEGER_CLASS:
|
case X86_64_INTEGER_CLASS:
|
||||||
case X86_64_INTEGERSI_CLASS:
|
case X86_64_INTEGERSI_CLASS:
|
||||||
/* Sign-extend integer arguments passed in general
|
/* Sign-extend integer arguments passed in general
|
||||||
|
|||||||
Reference in New Issue
Block a user