Fix image generation.
Small error passing wrong program in, tests and clean-oat didn't
catch for some reason.
Change-Id: Id4eab9e700b50ed76f98b66d55cca9d8ab93c70e
diff --git a/runtime/gc/space/image_space.cc b/runtime/gc/space/image_space.cc
index be39a58..4862c0a 100644
--- a/runtime/gc/space/image_space.cc
+++ b/runtime/gc/space/image_space.cc
@@ -56,10 +56,9 @@
std::vector<std::string> arg_vector;
- const char* dex2oat = GetAndroidRoot();
- std::string dex2oat_string(dex2oat);
- dex2oat_string += (kIsDebugBuild ? "/bin/dex2oatd" : "/bin/dex2oat");
- arg_vector.push_back(dex2oat_string);
+ std::string dex2oat = GetAndroidRoot();
+ dex2oat += (kIsDebugBuild ? "/bin/dex2oatd" : "/bin/dex2oat");
+ arg_vector.push_back(dex2oat);
std::string image_option_string("--image=");
image_option_string += image_file_name;
@@ -109,7 +108,7 @@
// change process groups, so we don't get reaped by ProcessManager
setpgid(0, 0);
- execv(dex2oat, &char_args[0]);
+ execv(dex2oat.c_str(), &char_args[0]);
PLOG(FATAL) << "execv(" << dex2oat << ") failed";
return false;