Support Runtime::Abort() before the runtime has started.
This lets you get useful diagnostics out of LOG(FATAL) and CHECK(FATAL) and
so on even if the problem occurs really early on.
Change-Id: I2bfd906191d8817de719c3d38e7fa5de844bebba
diff --git a/src/runtime.cc b/src/runtime.cc
index 6cb874f..306bb87 100644
--- a/src/runtime.cc
+++ b/src/runtime.cc
@@ -109,6 +109,10 @@
}
gAborting = true;
os << "Runtime aborting...\n";
+ if (Runtime::Current() == NULL) {
+ os << "(Runtime does not yet exist!)\n";
+ return;
+ }
Thread* self = Thread::Current();
if (self == NULL) {
os << "(Aborting thread was not attached to runtime!)\n";