ExecutionEngine: address review comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@216427 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Dylan Noblesmith 2014-08-26 02:03:28 +00:00
parent 71499d3a5d
commit 759a71a1fa

View File

@ -277,17 +277,16 @@ void *ArgvArray::reset(LLVMContext &C, ExecutionEngine *EE,
for (unsigned i = 0; i != InputArgv.size(); ++i) {
unsigned Size = InputArgv[i].size()+1;
auto DestOwner = make_unique<char[]>(Size);
char *Dest = DestOwner.get();
Values.push_back(std::move(DestOwner));
DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void*)Dest << "\n");
auto Dest = make_unique<char[]>(Size);
DEBUG(dbgs() << "JIT: ARGV[" << i << "] = " << (void*)Dest.get() << "\n");
std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest);
std::copy(InputArgv[i].begin(), InputArgv[i].end(), Dest.get());
Dest[Size-1] = 0;
// Endian safe: Array[i] = (PointerTy)Dest;
EE->StoreValueToMemory(PTOGV(Dest), (GenericValue*)(&Array[i*PtrSize]),
SBytePtr);
EE->StoreValueToMemory(PTOGV(Dest.get()),
(GenericValue*)(&Array[i*PtrSize]), SBytePtr);
Values.push_back(std::move(Dest));
}
// Null terminate it