Commit 9d88309
[lldb][RISCV] Use uint64_t for emulating ADDI (llvm#160550)
In RISC-V, the same instruction is used for both signed and unsigned
additions.
Signed integer overflow is undefined behavior in C++, but signed integer
overflow is defined behavior when using ADDI in RISC-V.
As we are emulating the RISC-V behavior we should be using uint.
This fix the failure with ubsan introduced by llvm#159842:
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')1 parent 4e8914f commit 9d88309
File tree
1 file changed
+1
-1
lines changed- lldb/source/Plugins/Instruction/RISCV
1 file changed
+1
-1
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
804 | 804 | | |
805 | 805 | | |
806 | 806 | | |
807 | | - | |
| 807 | + | |
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| |||
0 commit comments