mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
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.
This commit is contained in:
parent
d4a5b45242
commit
99e436eb05
6 changed files with 33 additions and 0 deletions
|
@ -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 {
|
||||
|
|
|
@ -456,3 +456,8 @@ interface TestBinding {
|
|||
[Func="TestBinding::condition_satisfied"]
|
||||
const unsigned short funcControlledConstEnabled = 0;
|
||||
};
|
||||
|
||||
partial interface TestBinding {
|
||||
[Pref="dom.testable_crash.enabled"]
|
||||
void crashHard();
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue