diff options
| author | Ralf Jung <post@ralfj.de> | 2018-08-06 14:39:55 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2018-08-06 14:39:55 +0200 |
| commit | 645388583ca47357a6a2e5878a9cde84e2e579d3 (patch) | |
| tree | b540ad370e3d571608473073de8de219bda2aff9 /src/libstd/sys/unix/args.rs | |
| parent | ab3e4a27894295ec0fca28b492450f2b22fbad4e (diff) | |
| download | rust-645388583ca47357a6a2e5878a9cde84e2e579d3.tar.gz rust-645388583ca47357a6a2e5878a9cde84e2e579d3.zip | |
actually, reentrant uninitialized mutex acquisition is outright UB
Diffstat (limited to 'src/libstd/sys/unix/args.rs')
| -rw-r--r-- | src/libstd/sys/unix/args.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libstd/sys/unix/args.rs b/src/libstd/sys/unix/args.rs index c91bd5b22af..220bd11b1f1 100644 --- a/src/libstd/sys/unix/args.rs +++ b/src/libstd/sys/unix/args.rs @@ -80,9 +80,8 @@ mod imp { static mut ARGC: isize = 0; static mut ARGV: *const *const u8 = ptr::null(); - // `ENV_LOCK` is never initialized fully, so this mutex is reentrant! - // Do not use it in a way that might be reentrant, that could lead to - // aliasing `&mut`. + // `ENV_LOCK` is never initialized fully, so it is UB to attempt to + // acquire this mutex reentrantly! static LOCK: Mutex = Mutex::new(); pub unsafe fn init(argc: isize, argv: *const *const u8) { |
