From 3389ca715ebb3d66ba192b657854f8b18e851ba8 Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 3 Dec 2014 14:35:54 +0000 Subject: Call ProcessStrings() in ImageWriter, fix prefix check. ProcessStrings was missing due to bad conflict resolution in cherry-pick https://android-review.googlesource.com/114971 The prefix check was broken by the "cherry-pick" https://android-review.googlesource.com/115445 where in addition to a simple cherry-pick, an additional comment was addressed and an error slipped in. Change-Id: I130d1d1a2995fd4a4c27c918c2a0dc38724ce68f --- compiler/image_writer.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'compiler/image_writer.cc') diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 3b1d914f6e..ab5c6c77de 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -77,6 +77,7 @@ bool ImageWriter::PrepareImageAddressSpace() { Thread::Current()->TransitionFromSuspendedToRunnable(); PruneNonImageClasses(); // Remove junk ComputeLazyFieldsForImageClasses(); // Add useful information + ProcessStrings(); Thread::Current()->TransitionFromRunnableToSuspended(kNative); } gc::Heap* heap = Runtime::Current()->GetHeap(); @@ -561,9 +562,9 @@ void ImageWriter::ProcessStrings() { bool is_prefix = false; if (it != existing_strings.end()) { CHECK_LE(length, it->second); - is_prefix = std::equal(combined_chars.begin() + it->first, - combined_chars.begin() + it->first + it->second, - combined_chars.begin() + new_string.first); + is_prefix = std::equal(combined_chars.begin() + new_string.first, + combined_chars.begin() + new_string.first + new_string.second, + combined_chars.begin() + it->first); } if (is_prefix) { // Shares a prefix, set the offset to where the new offset will be. -- cgit v1.2.3-59-g8ed1b