aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/testbinding.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2016-05-31 17:14:52 -0400
committerJosh Matthews <josh@joshmatthews.net>2016-06-20 18:32:48 -0400
commit99e436eb05577f28712e0e0731be72b8d391716f (patch)
treed3540d78e088e14ff815744d7359af968342d5ea /components/script/dom/testbinding.rs
parentd4a5b4524212f5607e874693778f131a9260e3ab (diff)
downloadservo-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.rs9
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 {