[libc++abi] Fix build failure in abort_message.cpp when vasprintf isn't provided
authorLouis Dionne <ldionne@apple.com>
Fri, 26 Jun 2020 15:49:44 +0000 (11:49 -0400)
committerLouis Dionne <ldionne@apple.com>
Fri, 26 Jun 2020 15:50:05 +0000 (11:50 -0400)
libcxxabi/src/abort_message.cpp

index c5abbe2..ad44063 100644 (file)
@@ -44,15 +44,21 @@ void abort_message(const char* format, ...)
 
     // Format the arguments into an allocated buffer. We leak the buffer on
     // purpose, since we're about to abort() anyway.
+#if defined(_LIBCXXABI_USE_CRASHREPORTER_CLIENT)
     char* buffer;
     va_list list;
     va_start(list, format);
     vasprintf(&buffer, format, list);
     va_end(list);
 
-#if defined(_LIBCXXABI_USE_CRASHREPORTER_CLIENT)
     CRSetCrashLogMessage(buffer);
 #elif defined(__BIONIC__)
+    char* buffer;
+    va_list list;
+    va_start(list, format);
+    vasprintf(&buffer, format, list);
+    va_end(list);
+
 #   if __ANDROID_API__ >= 21
     // Show error in tombstone.
     android_set_abort_message(buffer);