diff options
| author | 2016-06-24 11:56:59 +0100 | |
|---|---|---|
| committer | 2016-06-24 15:42:36 +0100 | |
| commit | 4d2bb1bc0a31e52910d2dcac60c685f5ef89ffbf (patch) | |
| tree | 1eb3bc323ffe117449212e21110fd8e781a9b3dd /compiler/utils/string_reference.h | |
| parent | ee2d222cc5a2e498540b7f767e76d602efc27178 (diff) | |
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
Diffstat (limited to 'compiler/utils/string_reference.h')
| -rw-r--r-- | compiler/utils/string_reference.h | 7 |
1 files changed, 3 insertions, 4 deletions
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 <stdint.h> #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; } } }; |