mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[runtime] Improve unrecognized-selector error message for pure-Swift classes.
Swift SVN r20577
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
#include <pthread.h>
|
||||
#include <malloc/malloc.h>
|
||||
#include <asl.h>
|
||||
#include "Debug.h"
|
||||
|
||||
|
||||
#if SWIFT_HAVE_CRASHREPORTERCLIENT
|
||||
@@ -70,6 +71,24 @@ reportNow(const char *message)
|
||||
}
|
||||
|
||||
|
||||
// Report a fatal error to system console, stderr, and crash logs, then abort.
|
||||
LLVM_ATTRIBUTE_NORETURN
|
||||
void
|
||||
swift::fatalError(const char *format, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, format);
|
||||
|
||||
char *log;
|
||||
vasprintf(&log, format, args);
|
||||
|
||||
reportNow(log);
|
||||
reportOnCrash(log);
|
||||
|
||||
abort();
|
||||
}
|
||||
|
||||
|
||||
// Report a fatal error to system console, stderr, and crash logs.
|
||||
// <prefix>: <message>: file <file>, line <line>\n
|
||||
// The message may be omitted by passing messageLength=0.
|
||||
|
||||
Reference in New Issue
Block a user