diff options
author | Josh Matthews <josh@joshmatthews.net> | 2016-05-31 17:14:52 -0400 |
---|---|---|
committer | Josh Matthews <josh@joshmatthews.net> | 2016-06-20 18:32:48 -0400 |
commit | 99e436eb05577f28712e0e0731be72b8d391716f (patch) | |
tree | d3540d78e088e14ff815744d7359af968342d5ea /components/script/dom/testbinding.rs | |
parent | d4a5b4524212f5607e874693778f131a9260e3ab (diff) | |
download | servo-99e436eb05577f28712e0e0731be72b8d391716f.tar.gz servo-99e436eb05577f28712e0e0731be72b8d391716f.zip |
Add a test that forces a crash. This makes it easy to manually check the output of a segfault with a complicated backtrace; the actual automation doesn't help us except to verify that the crash continues to happen as excepted.
Diffstat (limited to 'components/script/dom/testbinding.rs')
-rw-r--r-- | components/script/dom/testbinding.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/components/script/dom/testbinding.rs b/components/script/dom/testbinding.rs index 95341751780..bbbbc8aa5d6 100644 --- a/components/script/dom/testbinding.rs +++ b/components/script/dom/testbinding.rs @@ -571,6 +571,15 @@ impl TestBindingMethods for TestBinding { fn FuncControlledAttributeEnabled(&self) -> bool { false } fn FuncControlledMethodDisabled(&self) {} fn FuncControlledMethodEnabled(&self) {} + + #[allow(unsafe_code)] + fn CrashHard(&self) { + static READ_ONLY_VALUE: i32 = 0; + unsafe { + let p: *mut u32 = &READ_ONLY_VALUE as *const _ as *mut _; + ptr::write_volatile(p, 0xbaadc0de); + } + } } impl TestBinding { |