Skip to content

Commit 2a244dc

Browse files
committed
no TLS dtor and no leak checks on macOS
1 parent e2ec521 commit 2a244dc

File tree

4 files changed

+8
-5
lines changed

4 files changed

+8
-5
lines changed

src/fn_call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ impl<'a, 'mir, 'tcx: 'mir + 'a> EvalContextExt<'tcx, 'mir> for EvalContext<'a, '
539539
}
540540

541541
"_tlv_atexit" => {
542-
return err!(Unimplemented("Thread-local store is not fully supported on macOS".to_owned()));
542+
// FIXME: Register the dtor
543543
},
544544

545545
// Determining stack base address

src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,9 @@ pub fn eval_main<'a, 'tcx: 'a>(
161161
let leaks = ecx.memory().leak_report();
162162
// Disable the leak test on some platforms where we likely do not
163163
// correctly implement TLS destructors.
164-
let target_os = &ecx.tcx.tcx.sess.target.target.target_os;
165-
if target_os.to_lowercase() != "windows" && leaks != 0 {
164+
let target_os = ecx.tcx.tcx.sess.target.target.target_os.to_lowercase();
165+
let ignore_leaks = target_os == "windows" || target_os == "macos";
166+
if !ignore_leaks && leaks != 0 {
166167
tcx.sess.err("the evaluated program leaked memory");
167168
}
168169
}

tests/compile-fail/memleak.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// ignore-windows
1+
// ignore-windows: We do not check leaks on Windows
2+
// ignore-macos: We do not check leaks on macOS
23

34
//error-pattern: the evaluated program leaked memory
45

tests/compile-fail/memleak_rc.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
// ignore-windows
1+
// ignore-windows: We do not check leaks on Windows
2+
// ignore-macos: We do not check leaks on macOS
23

34
//error-pattern: the evaluated program leaked memory
45

0 commit comments

Comments
 (0)