From 47c83eac0644a4b6092d956dd3a6824bccb7263a Mon Sep 17 00:00:00 2001 From: Calin Juravle Date: Wed, 20 Jan 2016 03:56:12 +0000 Subject: Make sure that OfflineCompilationInfo is set to nullptr when needed. Local variables weren't initialized when in tests and the early return in ProcessProfiles didn't make sure that the output parameter is set to nullptr. Bug: 26080105 Change-Id: Id88a6abb515c3ab9a6ebac56bc9dac7920c3d58f --- compiler/profile_assistant.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/profile_assistant.cc') diff --git a/compiler/profile_assistant.cc b/compiler/profile_assistant.cc index 0871722440..85335efcc4 100644 --- a/compiler/profile_assistant.cc +++ b/compiler/profile_assistant.cc @@ -31,6 +31,7 @@ bool ProfileAssistant::ProcessProfilesInternal( DCHECK(!profile_files.empty()); DCHECK(!reference_profile_files.empty() || (profile_files.size() == reference_profile_files.size())); + std::vector new_info(profile_files.size()); bool should_compile = false; // Read the main profile files. @@ -44,7 +45,6 @@ bool ProfileAssistant::ProcessProfilesInternal( } if (!should_compile) { - *profile_compilation_info = nullptr; return true; } @@ -124,6 +124,8 @@ bool ProfileAssistant::ProcessProfiles( const std::vector& profile_files_fd, const std::vector& reference_profile_files_fd, /*out*/ ProfileCompilationInfo** profile_compilation_info) { + *profile_compilation_info = nullptr; + std::string error; ScopedCollectionFlock profile_files_flocks(profile_files_fd.size()); if (!profile_files_flocks.Init(profile_files_fd, &error)) { @@ -145,6 +147,8 @@ bool ProfileAssistant::ProcessProfiles( const std::vector& profile_files, const std::vector& reference_profile_files, /*out*/ ProfileCompilationInfo** profile_compilation_info) { + *profile_compilation_info = nullptr; + std::string error; ScopedCollectionFlock profile_files_flocks(profile_files.size()); if (!profile_files_flocks.Init(profile_files, &error)) { -- cgit v1.2.3-59-g8ed1b