rust/library/std/src/sys
Alex Crichton d6b06b8a32 std: Fix a bug on the wasm32-wasi target opening files
This commit fixes an issue pointed out in #82758 where LTO changed the
behavior of a program. It turns out that LTO was not at fault here, it
simply uncovered an existing bug. The bindings to
`__wasilibc_find_relpath` assumed that the relative portion of the path
returned was always contained within thee input `buf` we passed in. This
isn't actually the case, however, and sometimes the relative portion of
the path may reference a sub-portion of the input string itself.

The fix here is to use the relative path pointer coming out of
`__wasilibc_find_relpath` as the source of truth. The `buf` used for
local storage is discarded in this function and the relative path is
copied out unconditionally. We might be able to get away with some
`Cow`-like business or such to avoid the extra allocation, but for now
this is probably the easiest patch to fix the original issue.
2021-03-05 08:43:25 -08:00
..
hermit deprecate atomic::spin_loop_hint in favour of hint::spin_loop 2021-01-13 16:30:29 +10:00
sgx Auto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett 2021-03-03 05:45:50 +00:00
unix Rollup merge of #82589 - LinkTed:master, r=joshtriplett 2021-03-03 16:27:41 +09:00
unsupported Disambiguate symlink argument names 2020-11-14 14:46:14 -08:00
vxworks Take some of sys/vxworks/process/* from sys/unix instead. 2020-10-16 06:22:05 +02:00
wasi std: Fix a bug on the wasm32-wasi target opening files 2021-03-05 08:43:25 -08:00
wasm sys: use process::abort() instead of arch::wasm32::unreachable() 2021-01-29 20:25:23 +01:00
windows library: Normalize safety-for-unsafe-block comments 2021-02-24 06:13:42 +01:00
mod.rs Add missing stability attributes in libstd 2021-03-01 20:28:37 +01:00