summaryrefslogtreecommitdiffstats
path: root/dex2oat/dex2oat.cc
diff options
context:
space:
mode:
authorAndreas Gampe <agampe@google.com>2015-04-09 14:46:31 -0700
committerAndreas Gampe <agampe@google.com>2015-04-09 14:46:31 -0700
commite3712d074a6e9b5d6dfd2db33c556f25b713dade (patch)
tree427833a3e7fcb0f1069f54ed70f665d68c349e6a /dex2oat/dex2oat.cc
parent917f0866f66d3465fa41ddcf9ab09eba2fa78dd3 (diff)
downloadart-e3712d074a6e9b5d6dfd2db33c556f25b713dade.zip
art-e3712d074a6e9b5d6dfd2db33c556f25b713dade.tar.gz
art-e3712d074a6e9b5d6dfd2db33c556f25b713dade.tar.bz2
ART: Use canonical location in dex2oat
To filter class-path dex files, use the canonical location, not the location. That will correctly resolve relative vs absolute paths. Bug: 20133593 Change-Id: I894656cb6bef75cdaffb188987af0a3647c74ad6
Diffstat (limited to 'dex2oat/dex2oat.cc')
-rw-r--r--dex2oat/dex2oat.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc
index 2e1b7ae..10949e4 100644
--- a/dex2oat/dex2oat.cc
+++ b/dex2oat/dex2oat.cc
@@ -1503,11 +1503,16 @@ class Dex2Oat FINAL {
return failure_count;
}
- // Returns true if dex_files has a dex with the named location.
+ // Returns true if dex_files has a dex with the named location. We compare canonical locations,
+ // so that relative and absolute paths will match. Not caching for the dex_files isn't very
+ // efficient, but under normal circumstances the list is neither large nor is this part too
+ // sensitive.
static bool DexFilesContains(const std::vector<const DexFile*>& dex_files,
const std::string& location) {
+ std::string canonical_location(DexFile::GetDexCanonicalLocation(location.c_str()));
for (size_t i = 0; i < dex_files.size(); ++i) {
- if (dex_files[i]->GetLocation() == location) {
+ if (DexFile::GetDexCanonicalLocation(dex_files[i]->GetLocation().c_str()) ==
+ canonical_location) {
return true;
}
}