Commit 6a6b2483 authored by Victor Stinner's avatar Victor Stinner Committed by GitHub

bpo-29565: Fix compilation for C89 (GH-8626)

Use a local scope for the 'i' variable.
parent 3243f8c1
...@@ -220,14 +220,18 @@ ffi_call(/*@dependent@*/ ffi_cif *cif, ...@@ -220,14 +220,18 @@ ffi_call(/*@dependent@*/ ffi_cif *cif,
break; break;
#else #else
case FFI_SYSV: case FFI_SYSV:
/* If a single argument takes more than 8 bytes, /* use a local scope for the 'i' variable */
then a copy is passed by reference. */ {
for (unsigned i = 0; i < cif->nargs; i++) { unsigned i;
size_t z = cif->arg_types[i]->size; /* If a single argument takes more than 8 bytes,
if (z > 8) { then a copy is passed by reference. */
void *temp = alloca(z); for (i = 0; i < cif->nargs; i++) {
memcpy(temp, avalue[i], z); size_t z = cif->arg_types[i]->size;
avalue[i] = temp; if (z > 8) {
void *temp = alloca(z);
memcpy(temp, avalue[i], z);
avalue[i] = temp;
}
} }
} }
/*@-usedef@*/ /*@-usedef@*/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment