summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--runtime/runtime.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/runtime/runtime.cc b/runtime/runtime.cc
index 8e3d71a79e..182319a27c 100644
--- a/runtime/runtime.cc
+++ b/runtime/runtime.cc
@@ -548,18 +548,18 @@ struct AbortState {
void Runtime::Abort(const char* msg) {
auto old_value = gAborting.fetch_add(1); // set before taking any locks
-#ifdef ART_TARGET_ANDROID
+ // Only set the first abort message.
if (old_value == 0) {
- // Only set the first abort message.
+#ifdef ART_TARGET_ANDROID
android_set_abort_message(msg);
- }
#else
- UNUSED(old_value);
-#endif
-
-#ifdef ART_TARGET_ANDROID
- android_set_abort_message(msg);
+ // Set the runtime fault message in case our unexpected-signal code will run.
+ Runtime* current = Runtime::Current();
+ if (current != nullptr) {
+ current->SetFaultMessage(msg);
+ }
#endif
+ }
// Ensure that we don't have multiple threads trying to abort at once,
// which would result in significantly worse diagnostics.