mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-02 15:56:09 +03:00
fix write_os_str_to_wide_str
This commit is contained in:
+1
-1
@@ -146,7 +146,7 @@ fn os_str_to_u16vec<'tcx>(os_str: &OsStr) -> InterpResult<'tcx, Vec<u16>> {
|
||||
let this = self.eval_context_mut();
|
||||
let mut alloc = this
|
||||
.memory
|
||||
.get_mut(sptr, Size::from_bytes(string_length), Align::from_bytes(2).unwrap())?
|
||||
.get_mut(sptr, size2 * string_length, Align::from_bytes(2).unwrap())?
|
||||
.unwrap(); // not a ZST, so we will get a result
|
||||
for (offset, wchar) in u16_vec.into_iter().chain(iter::once(0x0000)).enumerate() {
|
||||
let offset = u64::try_from(offset).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user