SET_STATUS_Failure( VKI_EBADF );
} else {
SizeT vec_count = (SizeT)iocb->aio_nbytes;
-#if defined(__clang__)
-#pragma clang diagnostic push
- // yes, I know it is volatile
-#pragma clang diagnostic ignored "-Wcast-qual"
-#endif
- struct vki_iovec* p_iovec = (struct vki_iovec*)iocb->aio_buf;
-#if defined(__clang__)
-#pragma clang diagnostic pop
-#endif
+ struct vki_iovec* p_iovec = (struct vki_iovec*)(uintptr_t)iocb->aio_buf;
PRE_MEM_READ("aio_readv(iocb->aio_iov)", (Addr)p_iovec, vec_count*sizeof(struct vki_iovec));
if (ML_(safe_to_deref)(p_iovec, vec_count*sizeof(struct vki_iovec))) {
for (SizeT i = 0U; i < vec_count; ++i) {
{
MC_Error extra;
tl_assert(VG_INVALID_THREADID != tid);
+ /*
+ * We can't fill the Block as in freemismatch above.
+ * That's because if realloc size zero frees we literally do that
+ * and transform the call into a free before bothering to get the
+ * old MC_Chunk.
+ *
+ * See VG_(maybe_record_error) for a description of how this gets
+ * filled on demand.
+ */
extra.Err.ReallocSizeZero.ai.tag = Addr_Undescribed;
VG_(maybe_record_error)( tid, Err_ReallocSizeZero, a, /*s*/NULL, &extra );
}