From 4d2bb1bc0a31e52910d2dcac60c685f5ef89ffbf Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Fri, 24 Jun 2016 11:56:59 +0100 Subject: Fix StringReferenceValueComparator. Test: Added a regression test in string_reference_test.cc, run the standard ART test suite on host and Nexus 5. Bug: 29602109 Change-Id: Idcc059a07df048a0e3ece257b16b6556f242243e --- compiler/utils/string_reference.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'compiler/utils/string_reference.h') diff --git a/compiler/utils/string_reference.h b/compiler/utils/string_reference.h index 9e1058ea4d..0ab45c86e3 100644 --- a/compiler/utils/string_reference.h +++ b/compiler/utils/string_reference.h @@ -20,12 +20,11 @@ #include #include "base/logging.h" +#include "dex_file-inl.h" #include "utf-inl.h" namespace art { -class DexFile; - // A string is located by its DexFile and the string_ids_ table index into that DexFile. struct StringReference { StringReference(const DexFile* file, uint32_t index) : dex_file(file), string_index(index) { } @@ -48,13 +47,13 @@ struct StringReferenceValueComparator { sr1.string_index < sr2.string_index, CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues( sr1.dex_file->GetStringData(sr1.dex_file->GetStringId(sr1.string_index)), - sr1.dex_file->GetStringData(sr2.dex_file->GetStringId(sr2.string_index))) < 0); + sr2.dex_file->GetStringData(sr2.dex_file->GetStringId(sr2.string_index))) < 0); return sr1.string_index < sr2.string_index; } else { // Cannot compare indexes, so do the string comparison. return CompareModifiedUtf8ToModifiedUtf8AsUtf16CodePointValues( sr1.dex_file->GetStringData(sr1.dex_file->GetStringId(sr1.string_index)), - sr1.dex_file->GetStringData(sr2.dex_file->GetStringId(sr2.string_index))) < 0; + sr2.dex_file->GetStringData(sr2.dex_file->GetStringId(sr2.string_index))) < 0; } } }; -- cgit v1.2.3-59-g8ed1b