diff options
author | Vladimir Marko <vmarko@google.com> | 2014-05-28 21:41:35 +0100 |
---|---|---|
committer | Vladimir Marko <vmarko@google.com> | 2014-05-29 09:54:08 +0100 |
commit | a9f1ce6fbe8a9247d0d8e20727f590b091e816da (patch) | |
tree | fc165edcc2c68a19e3df1edfb65f6c3599aebdfb /dex2oat | |
parent | b661a80aab8b8f25590f3165b08647d1df7021f3 (diff) | |
download | art-a9f1ce6fbe8a9247d0d8e20727f590b091e816da.zip art-a9f1ce6fbe8a9247d0d8e20727f590b091e816da.tar.gz art-a9f1ce6fbe8a9247d0d8e20727f590b091e816da.tar.bz2 |
Fix pass driver's dump_pass_list_ and print_pass_list_.
The lists were allocated with new char[], so they should
have been held by std::unique_ptr<const char[]> rather than
std::unique_ptr<const char>. However, it's much cleaner with
std::string.
Change-Id: Ie7c604773272194345f5e6e3c4803c3a914edf99
Diffstat (limited to 'dex2oat')
-rw-r--r-- | dex2oat/dex2oat.cc | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 91a1418..4d3d664 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -925,18 +925,12 @@ static int dex2oat(int argc, char** argv) { PassDriverME::CreateDefaultPassList(disable_passes); } else if (option.starts_with("--print-passes=")) { std::string print_passes = option.substr(strlen("--print-passes=")).data(); - size_t len = print_passes.length() + 1; - char* duplicate = new char[len]; - strncpy(duplicate, print_passes.c_str(), len); - PassDriverME::SetPrintPassList(duplicate); + PassDriverME::SetPrintPassList(print_passes); } else if (option == "--print-all-passes") { PassDriverME::SetPrintAllPasses(); } else if (option.starts_with("--dump-cfg-passes=")) { std::string dump_passes = option.substr(strlen("--dump-cfg-passes=")).data(); - size_t len = dump_passes.length() + 1; - char* duplicate = new char[len]; - strncpy(duplicate, dump_passes.c_str(), len); - PassDriverME::SetDumpPassList(duplicate); + PassDriverME::SetDumpPassList(dump_passes); } else { Usage("Unknown argument %s", option.data()); } |