Skip to content

Commit

Permalink
[sanitizer] zx_vmo_write on Fuchsia takes only 4 arguments now
Browse files Browse the repository at this point in the history
The system call now fails when it cannot write the requested size.
Update the sanitizer runtime Fuchsia implementation accordingly.

Differential Revision: https://reviews.llvm.org/D44770

llvm-svn: 328273
  • Loading branch information
petrhosek committed Mar 22, 2018
1 parent fab7a67 commit f4ec686
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions compiler-rt/lib/sanitizer_common/sanitizer_fuchsia.cc
Original file line number Diff line number Diff line change
Expand Up @@ -418,16 +418,7 @@ bool IsAccessibleMemoryRange(uptr beg, uptr size) {
zx_handle_t vmo;
zx_status_t status = _zx_vmo_create(size, 0, &vmo);
if (status == ZX_OK) {
while (size > 0) {
size_t wrote;
status = _zx_vmo_write(vmo, reinterpret_cast<const void *>(beg), 0, size,
&wrote);
if (status != ZX_OK) break;
CHECK_GT(wrote, 0);
CHECK_LE(wrote, size);
beg += wrote;
size -= wrote;
}
status = _zx_vmo_write(vmo, reinterpret_cast<const void *>(beg), 0, size);
_zx_handle_close(vmo);
}
return status == ZX_OK;
Expand Down

0 comments on commit f4ec686

Please sign in to comment.