Fixed the wrong base addr being used (#267) accepted/tizen/unified/20200812.143852 submit/tizen/20200812.015836
author조웅석/Common Platform Lab(SR)/Principal Engineer/삼성전자 <ws77.cho@samsung.com>
Wed, 12 Aug 2020 01:51:59 +0000 (10:51 +0900)
committer이형주/Common Platform Lab(SR)/Staff Engineer/삼성전자 <leee.lee@samsung.com>
Wed, 12 Aug 2020 01:51:59 +0000 (10:51 +0900)
A pointer of a temporally created string object is put into a vector in
the "if" statement. So, wrong value is set for /BaseAddress option.

NativeLauncher/tool/ni_common.cc

index 594fe3a..fe1ce7b 100644 (file)
@@ -337,9 +337,11 @@ static ni_error_e crossgen(const std::string& dllPath, const std::string& appPat
                }
 
 #ifdef UNIQUE_DEFAULT_BASE_ADDR_SUPPORT
+               char baseAddrString[11] = {0};
                if (baseAddr != 0) {
                        argv.push_back("/BaseAddress");
-                       argv.push_back(std::to_string(baseAddr).c_str());
+                       snprintf(baseAddrString, 11, "0x%08x", baseAddr);
+                       argv.push_back(baseAddrString);
                }
 #endif