2 // Test that cleanups for the RHS of shortcircuiting operators work.
4 // pretty-expanded FIXME #23616
6 #![allow(deref_nullptr)]
12 let args: Vec<String> = env::args().collect();
14 // Here, the rvalue `"signal".to_string()` requires cleanup. Older versions
15 // of the code had a problem that the cleanup scope for this
16 // expression was the end of the `if`, and as the `"signal".to_string()`
17 // expression was never evaluated, we wound up trying to clean
18 // uninitialized memory.
20 if args.len() >= 2 && args[1] == "signal" {
22 unsafe { *std::ptr::null_mut::<isize>() = 0; }