unix: work around arm-linux-gnueabihf-gcc bug (#4565)
Both gcc 11 and 12 emit wrong code for a function call pointer in one very specific context. Fixes: https://github.com/libuv/libuv/issues/4532
This commit is contained in:
parent
0be52c8251
commit
8d957c56b3
@ -487,7 +487,10 @@ static ssize_t uv__preadv_or_pwritev(int fd,
|
||||
atomic_store_explicit(cache, (uintptr_t) p, memory_order_relaxed);
|
||||
}
|
||||
|
||||
f = p;
|
||||
/* Use memcpy instead of `f = p` to work around a compiler bug,
|
||||
* see https://github.com/libuv/libuv/issues/4532
|
||||
*/
|
||||
memcpy(&f, &p, sizeof(p));
|
||||
return f(fd, bufs, nbufs, off);
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user