diff options
author | Brian Anderson <banderson@mozilla.com> | 2015-05-09 02:11:18 -0700 |
---|---|---|
committer | Brian Anderson <banderson@mozilla.com> | 2015-05-09 02:11:18 -0700 |
commit | 8975a3bd9b67a3a54196943ab975fda4b53d57fe (patch) | |
tree | 28ff8376f8f8524c3a64cc0bae6026f34cc3256e /components/util/opts.rs | |
parent | 17747ad0e23c8213da3d5a550ade28baece33de0 (diff) | |
download | servo-8975a3bd9b67a3a54196943ab975fda4b53d57fe.tar.gz servo-8975a3bd9b67a3a54196943ab975fda4b53d57fe.zip |
Add an assert to opts::set_opts.
This function leaks if called more than once.
Diffstat (limited to 'components/util/opts.rs')
-rw-r--r-- | components/util/opts.rs | 1 |
1 files changed, 1 insertions, 0 deletions
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); } |