mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
chore: simplify intentional-crash code (#19464)
This commit is contained in:
@@ -35,11 +35,6 @@ namespace electron {
|
||||
|
||||
namespace {
|
||||
|
||||
// Dummy class type that used for crashing the program.
|
||||
struct DummyClass {
|
||||
bool crash;
|
||||
};
|
||||
|
||||
// Called when there is a fatal error in V8, we just crash the process here so
|
||||
// we can get the stack trace.
|
||||
void FatalErrorCallback(const char* location, const char* message) {
|
||||
@@ -152,7 +147,8 @@ void ElectronBindings::Log(const base::string16& message) {
|
||||
|
||||
// static
|
||||
void ElectronBindings::Crash() {
|
||||
static_cast<DummyClass*>(nullptr)->crash = true;
|
||||
volatile int* zero = nullptr;
|
||||
*zero = 0;
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
Reference in New Issue
Block a user