From 283a130ddafa01537123b0650f869abc14886911 Mon Sep 17 00:00:00 2001 From: Christian Poveda Date: Sun, 20 Oct 2019 17:40:21 -0500 Subject: [PATCH] Add docs for the new helper functions --- src/helpers.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 63380199bea..4d84106dbe8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -346,11 +346,15 @@ fn check_no_isolation(&mut self, name: &str) -> InterpResult<'tcx> { Ok(()) } + /// Helper function to read an OsString from a null-terminated sequence of bytes, which is what + /// the Unix APIs usually handle. fn read_os_string_from_c_string(&mut self, scalar: Scalar) -> InterpResult<'tcx, OsString> { let bytes = self.eval_context_mut().memory.read_c_str(scalar)?; Ok(bytes_to_os_str(bytes)?.into()) } + /// Helper function to write an OsStr as a null-terminated sequence of bytes, which is what + /// the Unix APIs usually handle. fn write_os_str_to_c_string(&mut self, os_str: &OsStr, ptr: Pointer, size: u64) -> InterpResult<'tcx> { let bytes = os_str_to_bytes(os_str)?; let len = bytes.len(); -- 2.44.0