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
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 3b1d914..ab5c6c7 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -77,6 +77,7 @@
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 @@
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.