From 53a8fbeb2a0912e928609f0afcea6ffb1e911193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Legan=C3=A9s-Combarro=20=27piranna?= Date: Sat, 6 Jul 2019 13:03:04 +0200 Subject: [PATCH] [___syscall146] Move loop out of `unsafe` zone --- lib/emscripten/src/syscalls/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/emscripten/src/syscalls/mod.rs b/lib/emscripten/src/syscalls/mod.rs index 38681fa71..83bfa484c 100644 --- a/lib/emscripten/src/syscalls/mod.rs +++ b/lib/emscripten/src/syscalls/mod.rs @@ -496,8 +496,8 @@ pub fn ___syscall146(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 { debug!("=> fd: {}, iov: {}, iovcnt = {}", fd, iov, iovcnt); let mut ret = 0; - unsafe { - for i in 0..iovcnt { + for i in 0..iovcnt { + unsafe { let guest_iov_addr = emscripten_memory_pointer!(ctx.memory(0), (iov + i * 8)) as *mut GuestIovec; let iov_base = emscripten_memory_pointer!(ctx.memory(0), (*guest_iov_addr).iov_base) @@ -510,9 +510,9 @@ pub fn ___syscall146(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 { } ret += curr; } - // debug!(" => ret: {}", ret); - ret as _ } + debug!(" => ret: {}", ret); + ret as _ } pub fn ___syscall191(ctx: &mut Ctx, _which: i32, mut varargs: VarArgs) -> i32 {