From 8975a3bd9b67a3a54196943ab975fda4b53d57fe Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sat, 9 May 2015 02:11:18 -0700 Subject: [PATCH] Add an assert to opts::set_opts. This function leaks if called more than once. --- components/util/opts.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/components/util/opts.rs b/components/util/opts.rs index 5816ec313aa..d2599fb128d 100644 --- a/components/util/opts.rs +++ b/components/util/opts.rs @@ -425,6 +425,7 @@ static mut OPTIONS: *mut Opts = 0 as *mut Opts; pub fn set_opts(opts: Opts) { unsafe { + assert!(OPTIONS.is_null()); let box_opts = box opts; OPTIONS = mem::transmute(box_opts); }