Fix UB in EmulateInstructionARM64.cpp
authorAdrian Prantl <aprantl@apple.com>
Mon, 1 Jun 2020 21:23:04 +0000 (14:23 -0700)
committerAdrian Prantl <aprantl@apple.com>
Tue, 2 Jun 2020 01:11:50 +0000 (18:11 -0700)
commita0b674fd7f06b86241cf19387313b508248a3868
treec86411dd29586469d1faea436e22782e3074b1bc
parenta66e1d2aa943959e158821be8956109cb5ef3b3b
Fix UB in EmulateInstructionARM64.cpp

This fixes an unhandled signed integer overflow in AddWithCarry() by
using the llvm::checkedAdd() function. Thats to Vedant Kumar for the
suggestion!

<rdar://problem/60926115>

Differential Revision: https://reviews.llvm.org/D80955
lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.cpp
lldb/source/Plugins/Instruction/ARM64/EmulateInstructionARM64.h
lldb/unittests/CMakeLists.txt
lldb/unittests/Instruction/CMakeLists.txt [new file with mode: 0644]
lldb/unittests/Instruction/TestAArch64Emulator.cpp [new file with mode: 0644]