bpo-29565: Fix compilation for C89 (GH-8626) · python/cpython@6a6b248 (original) (raw)
File tree
1 file changed
lines changed
- Modules/_ctypes/libffi_msvc
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -220,14 +220,18 @@ ffi_call(/*@dependent@*/ ffi_cif *cif, | ||
220 | 220 | break; |
221 | 221 | #else |
222 | 222 | case FFI_SYSV: |
223 | -/* If a single argument takes more than 8 bytes, | |
224 | - then a copy is passed by reference. */ | |
225 | -for (unsigned i = 0; i < cif->nargs; i++) { | |
226 | -size_t z = cif->arg_types[i]->size; | |
227 | -if (z > 8) { | |
228 | -void *temp = alloca(z); | |
229 | -memcpy(temp, avalue[i], z); | |
230 | -avalue[i] = temp; | |
223 | +/* use a local scope for the 'i' variable */ | |
224 | + { | |
225 | +unsigned i; | |
226 | +/* If a single argument takes more than 8 bytes, | |
227 | + then a copy is passed by reference. */ | |
228 | +for (i = 0; i < cif->nargs; i++) { | |
229 | +size_t z = cif->arg_types[i]->size; | |
230 | +if (z > 8) { | |
231 | +void *temp = alloca(z); | |
232 | +memcpy(temp, avalue[i], z); | |
233 | +avalue[i] = temp; | |
234 | + } | |
231 | 235 | } |
232 | 236 | } |
233 | 237 | /*@-usedef@*/ |