diff options
| author | David Blaikie <dblaikie@gmail.com> | 2017-01-06 00:38:06 +0000 |
|---|---|---|
| committer | David Blaikie <dblaikie@gmail.com> | 2017-01-06 00:38:06 +0000 |
| commit | a322f36cfd7f2eb81b1527f2b4d786afdac4f7a4 (patch) | |
| tree | 44c9dd582d0efc866da28073e2b34ee1fc8f736d /lldb/source/Expression | |
| parent | 049b017538e44c20be1ef3f9d19d0bcb90284c4a (diff) | |
| download | bcm5719-llvm-a322f36cfd7f2eb81b1527f2b4d786afdac4f7a4.tar.gz bcm5719-llvm-a322f36cfd7f2eb81b1527f2b4d786afdac4f7a4.zip | |
Make lldb -Werror clean for -Wstring-conversion
Also found/fixed one bug identified by this warning in
RenderScriptx86ABIFixups.cpp where a string literal was being used in an
effort to provide a name for an instruction/register, but was instead
being passed as the bool 'isVolatile' parameter.
llvm-svn: 291198
Diffstat (limited to 'lldb/source/Expression')
| -rw-r--r-- | lldb/source/Expression/IRInterpreter.cpp | 36 |
1 files changed, 17 insertions, 19 deletions
diff --git a/lldb/source/Expression/IRInterpreter.cpp b/lldb/source/Expression/IRInterpreter.cpp index ef96b85971b..e5705984eb8 100644 --- a/lldb/source/Expression/IRInterpreter.cpp +++ b/lldb/source/Expression/IRInterpreter.cpp @@ -1602,25 +1602,23 @@ bool IRInterpreter::Interpret(llvm::Module &module, llvm::Function &function, lldb::addr_t addr = tmp_op.ULongLong(); size_t dataSize = 0; - if (execution_unit.GetAllocSize(addr, dataSize)) { - // Create the required buffer - rawArgs[i].size = dataSize; - rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]); - - // Read string from host memory - execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize, - error); - if (error.Fail()) { - assert(!"we have failed to read the string from memory"); - return false; - } - // Add null terminator - rawArgs[i].data_ap[dataSize] = '\0'; - rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer; - } else { - assert(!"unable to locate host data for transfer to device"); - return false; - } + bool Success = execution_unit.GetAllocSize(addr, dataSize); + (void)Success; + assert(Success && + "unable to locate host data for transfer to device"); + // Create the required buffer + rawArgs[i].size = dataSize; + rawArgs[i].data_ap.reset(new uint8_t[dataSize + 1]); + + // Read string from host memory + execution_unit.ReadMemory(rawArgs[i].data_ap.get(), addr, dataSize, + error); + assert(!error.Fail() && + "we have failed to read the string from memory"); + + // Add null terminator + rawArgs[i].data_ap[dataSize] = '\0'; + rawArgs[i].type = lldb_private::ABI::CallArgument::HostPointer; } else /* if ( arg_ty->isPointerTy() ) */ { rawArgs[i].type = lldb_private::ABI::CallArgument::TargetValue; |

