From a11a34c908e847711e6ccf221d61b45d0c4c963d Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Fri, 6 Mar 2015 08:44:45 -0800 Subject: [PATCH] Do not dump memory usage if driver was never created Bug: https://code.google.com/p/android/issues/detail?id=158593 Change-Id: I8084f9ac823910aa11f854f3e764240741fbf0d5 --- dex2oat/dex2oat.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 8572f4d53..128f6238a 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -1647,9 +1647,10 @@ class Dex2Oat FINAL { void LogCompletionTime() { // Note: when creation of a runtime fails, e.g., when trying to compile an app but when there // is no image, there won't be a Runtime::Current(). + // Note: driver creation can fail when loading an invalid dex file. LOG(INFO) << "dex2oat took " << PrettyDuration(NanoTime() - start_ns_) << " (threads: " << thread_count_ << ") " - << ((Runtime::Current() != nullptr) ? + << ((Runtime::Current() != nullptr && driver_.get() != nullptr) ? driver_->GetMemoryUsageString(kIsDebugBuild || VLOG_IS_ON(compiler)) : ""); } -- 2.11.0