chore: simplify intentional-crash code (#19464)
This commit is contained in:
parent
71b1b69339
commit
33d1e87163
1 changed files with 2 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue