[Lldb-commits] [lldb] Reland #158161 with cmake fix (PR #159842)

Jordan Rupprecht via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 23 12:19:41 PDT 2025


================
@@ -737,11 +801,44 @@ class Executor {
   bool operator()(SH inst) { return Store<SH, uint16_t>(m_emu, inst); }
   bool operator()(SW inst) { return Store<SW, uint32_t>(m_emu, inst); }
   bool operator()(ADDI inst) {
-    return transformOptional(inst.rs1.ReadI64(m_emu),
-                             [&](int64_t rs1) {
-                               return inst.rd.Write(
-                                   m_emu, rs1 + int64_t(SignExt(inst.imm)));
-                             })
+    return transformOptional(
+               inst.rs1.ReadI64(m_emu),
+               [&](int64_t rs1) {
+                 int64_t result = rs1 + int64_t(SignExt(inst.imm));
----------------
rupprecht wrote:

Is this supposed to be uint64_t? I'm seeing this failure w/ ubsan: `lldb/source/Plugins/Instruction/RISCV/EmulateInstructionRISCV.cpp:807:40: runtime error: signed integer overflow: -9223372036854775808 + -16 cannot be represented in type 'int64_t' (aka 'long')`

This is fine: `uint64_t result = rs1 + uint64_t(SignExt(inst.imm));`

https://github.com/llvm/llvm-project/pull/159842


More information about the lldb-commits mailing list