summaryrefslogtreecommitdiff
path: root/source/Expression
diff options
context:
space:
mode:
Diffstat (limited to 'source/Expression')
-rw-r--r--source/Expression/IRInterpreter.cpp36
-rw-r--r--source/Expression/IRMemoryMap.cpp2
2 files changed, 18 insertions, 20 deletions
diff --git a/source/Expression/IRInterpreter.cpp b/source/Expression/IRInterpreter.cpp
index ef96b85971be1..e5705984eb87c 100644
--- a/source/Expression/IRInterpreter.cpp
+++ b/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;
diff --git a/source/Expression/IRMemoryMap.cpp b/source/Expression/IRMemoryMap.cpp
index 008838d5aab36..7b9d26667389d 100644
--- a/source/Expression/IRMemoryMap.cpp
+++ b/source/Expression/IRMemoryMap.cpp
@@ -126,7 +126,7 @@ lldb::addr_t IRMemoryMap::FindSpace(size_t size) {
err = process_sp->GetMemoryRegionInfo(
region_info.GetRange().GetRangeEnd(), region_info);
if (err.Fail()) {
- lldbassert(!"GetMemoryRegionInfo() succeeded, then failed");
+ lldbassert(0 && "GetMemoryRegionInfo() succeeded, then failed");
ret = LLDB_INVALID_ADDRESS;
break;
}