[Lldb-commits] [lldb] [lldb] Fix llvm_unreachable for invalid Wasm address (PR #176464)
Adrian Prantl via lldb-commits
lldb-commits at lists.llvm.org
Fri Jan 16 13:03:13 PST 2026
================
@@ -93,12 +93,16 @@ size_t ProcessWasm::ReadMemory(lldb::addr_t vm_addr, void *buf, size_t size,
case WasmAddressType::Memory:
case WasmAddressType::Object:
return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
- case WasmAddressType::Invalid:
- error.FromErrorStringWithFormat(
- "Wasm read failed for invalid address 0x%" PRIx64, vm_addr);
- return 0;
+ default:
----------------
adrian-prantl wrote:
My understanding of the language doesn't go deep enough. Would this have the same effect, but keep the missing-case-in-switch warning?
```
case WasmAddressType::Object:
return ProcessGDBRemote::ReadMemory(vm_addr, buf, size, error);
}
error.FromErrorStringWithFormatv(
"Wasm read failed for invalid address {0:x} (type = {1:x}, module = "
"{2:x}, offset = {3:x})",
vm_addr, wasm_addr.GetType(), wasm_addr.GetModuleID(),
wasm_addr.GetOffset());
return 0;
```
https://github.com/llvm/llvm-project/pull/176464
More information about the lldb-commits
mailing list