Remove null pointer checks generally, re-add them in Emscripten

This commit is contained in:
Mark McCaskey
2019-09-20 11:59:20 -07:00
parent 0790ebff0c
commit 882a77ccf9
9 changed files with 136 additions and 30 deletions

View File

@ -10,7 +10,10 @@ pub use self::unix::*;
#[cfg(windows)]
pub use self::windows::*;
use crate::utils::{copy_stat_into_wasm, get_cstr_path, get_current_directory};
use crate::{
ptr::{Array, WasmPtr},
utils::{copy_stat_into_wasm, get_cstr_path, get_current_directory},
};
use super::varargs::VarArgs;
use byteorder::{ByteOrder, LittleEndian};
@ -40,10 +43,7 @@ use libc::{
write,
// ENOTTY,
};
use wasmer_runtime_core::{
memory::ptr::{Array, WasmPtr},
vm::Ctx,
};
use wasmer_runtime_core::vm::Ctx;
use super::env;
use std::cell::Cell;

View File

@ -1,4 +1,4 @@
use crate::varargs::VarArgs;
use crate::{ptr::WasmPtr, varargs::VarArgs};
#[cfg(target_os = "macos")]
use libc::size_t;
/// NOTE: TODO: These syscalls only support wasm_32 for now because they assume offsets are u32
@ -111,7 +111,7 @@ fn translate_ioctl(wasm_ioctl: u32) -> c_ulong {
#[allow(unused_imports)]
use std::ffi::CStr;
use wasmer_runtime_core::{memory::ptr::WasmPtr, vm::Ctx};
use wasmer_runtime_core::vm::Ctx;
use crate::env::EmSockAddr;
use crate::utils::{self, get_cstr_path};