Message288031
This issue is more straight-forward than #22273. ISTM, we just have to copy large values. For example, in ffi_call, we'd iterate over the arguments and alloca and memcpy the large values prior to calling ffi_call_AMD64:
case FFI_SYSV:
/* If a single argument takes more than 8 bytes,
then a copy is passed by reference. */
for (unsigned i = 0; i < cif->nargs; i++) {
size_t z = cif->arg_types[i]->size;
if (z > 8) {
void *temp = alloca(z);
memcpy(temp, avalue[i], z);
avalue[i] = temp;
}
}
/*@-usedef@*/
return ffi_call_AMD64(ffi_prep_args, &ecif, cif->bytes,
cif->flags, ecif.rvalue, fn);
/*@=usedef@*/
break; |
|
Date |
User |
Action |
Args |
2017-02-17 18:06:09 | eryksun | set | recipients:
+ eryksun, doko, paul.moore, vinay.sajip, mark.dickinson, christian.heimes, tim.golden, meador.inge, zach.ware, steve.dower, Igor Kudrin |
2017-02-17 18:06:08 | eryksun | set | messageid: <1487354768.98.0.539543353446.issue29565@psf.upfronthosting.co.za> |
2017-02-17 18:06:08 | eryksun | link | issue29565 messages |
2017-02-17 18:06:08 | eryksun | create | |
|