vsk added inline comments.
Comment at: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:99
+ if (!overflow)
+overflow |= !llvm::checkedAdd(*signed_sum, SInt(carry_in));
uint64_t result = unsigned_sum;
aprantl wrote:
> vsk wrote:
> > The d
This revision was not accepted when it landed; it landed in state "Needs
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rGa0b674fd7f06: Fix UB in EmulateInstructionARM64.cpp
(authored by aprantl).
Herald added a subscriber: mgorny.
Herald added
aprantl added a comment.
> This is great Adrian. I feel like there are several other instances of
> additions that should use llvm::checkAdd here instead of +. Is this the only
> UB triggered in the testsuite?
It's the only UB caught by the green dragon / ci.swift.org bots.
CHANGES SINCE LAST
aprantl marked an inline comment as done.
aprantl added inline comments.
Comment at: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:99
+ if (!overflow)
+overflow |= !llvm::checkedAdd(*signed_sum, SInt(carry_in));
uint64_t result = unsigned_sum;
davide added a comment.
This is great Adrian. I feel like there are several other instances of
additions that should use `llvm::checkAdd` here instead of `+`. Is this the
only UB triggered in the testsuite?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80955/new/
https://reviews.llvm.
davide added inline comments.
Comment at: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:25
+#include
+
shafik wrote:
> Why? also should be `cstdlib` in C++.
It's just something shuffled around, probably a side effect of clang-format.
CHAN
shafik added inline comments.
Comment at: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:25
+#include
+
Why? also should be `cstdlib` in C++.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80955/new/
https://reviews.llvm.org/D80955
jasonmolenda added a comment.
Nice cleanup of a long standing undefined behavior warning.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80955/new/
https://reviews.llvm.org/D80955
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
htt
vsk added a comment.
I should add: otherwise, this looks good!
Comment at: lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp:99
+ if (!overflow)
+overflow |= !llvm::checkedAdd(*signed_sum, SInt(carry_in));
uint64_t result = unsigned_sum;
vsk added a comment.
Any chance we can export AddWithCarry via EmulateInstructionARM64.h, then add a
unit test in TestArm64InstEmulation.cpp?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D80955/new/
https://reviews.llvm.org/D80955
___
lldb
aprantl created this revision.
aprantl added reviewers: jasonmolenda, vsk.
Herald added subscribers: danielkiss, kristof.beyls.
This fixes an unhandled signed integer overflow in AddWithCarry() by using the
llvm::checkedAdd() function. Thats to @vsk for the suggestion!
https://reviews.llvm.org/
11 matches
Mail list logo