Skip to content

Commit

Permalink
Use __builtin_trap rather than exit so the crash report can be sent.
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu committed Aug 14, 2023
1 parent 51f78ff commit ffdf3fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/nnc/mfa/ccv_nnc_mfa_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void mfa::fatal_error(NS::Error* error, int line, const char *file_name, const c
std::cerr << METAL_LOG_HEADER << "Failure reason: " << failure_reason->cString(NS::UTF8StringEncoding) << std::endl;
}
std::cerr << METAL_LOG_HEADER << "Quitting now." << std::endl;
exit(-1);
__builtin_trap();
}

void mfa::precondition_failure(const char *message, int line, const char *file_name, const char *function_name) {
Expand All @@ -42,5 +42,5 @@ void mfa::precondition_failure(const char *message, int line, const char *file_n
}
std::cerr << "\e[0m" << std::endl;
std::cerr << METAL_LOG_HEADER << "Quitting now." << std::endl;
exit(-1);
__builtin_trap();
}

0 comments on commit ffdf3fa

Please sign in to comment.