Fix case where callback arg value is split across regs and stack
This commit is contained in:
@@ -215,7 +215,18 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
/* This is an 8-byte value. */
|
/* This is an 8-byte value. */
|
||||||
avalue[i] = ptr;
|
if (ptr == (char *) ®ister_args[5])
|
||||||
|
{
|
||||||
|
/* The value is split across two locations */
|
||||||
|
unsigned *ip = alloca(8);
|
||||||
|
avalue[i] = ip;
|
||||||
|
ip[0] = *(unsigned *) ptr;
|
||||||
|
ip[1] = *(unsigned *) stack_args;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
avalue[i] = ptr;
|
||||||
|
}
|
||||||
ptr += 4;
|
ptr += 4;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -223,9 +234,9 @@ void ffi_closure_eabi (unsigned arg1, unsigned arg2, unsigned arg3,
|
|||||||
|
|
||||||
/* If we've handled more arguments than fit in registers,
|
/* If we've handled more arguments than fit in registers,
|
||||||
start looking at the those passed on the stack. */
|
start looking at the those passed on the stack. */
|
||||||
if (ptr == ®ister_args[6])
|
if (ptr == (char *) ®ister_args[6])
|
||||||
ptr = stack_args;
|
ptr = stack_args;
|
||||||
else if (ptr == ®ister_args[7])
|
else if (ptr == (char *) ®ister_args[7])
|
||||||
ptr = stack_args + 4;
|
ptr = stack_args + 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user