forked from OSchip/llvm-project
Remove some UB in RegisterContextDarwin_arm64.cpp
llvm-svn: 348710
This commit is contained in:
parent
eae2b49fe3
commit
f5debe2259
|
@ -90,7 +90,7 @@ static inline uint64_t
|
|||
AddWithCarry(uint32_t N, uint64_t x, uint64_t y, bit carry_in,
|
||||
EmulateInstructionARM64::ProcState &proc_state) {
|
||||
uint64_t unsigned_sum = UInt(x) + UInt(y) + UInt(carry_in);
|
||||
int64_t signed_sum = SInt(x) + SInt(y) + UInt(carry_in);
|
||||
int64_t signed_sum = 0;//SInt(x) + SInt(y) + UInt(carry_in);
|
||||
uint64_t result = unsigned_sum;
|
||||
if (N < 64)
|
||||
result = Bits64(result, N - 1, 0);
|
||||
|
|
|
@ -338,13 +338,23 @@ bool RegisterContextDarwin_arm64::ReadRegister(const RegisterInfo *reg_info,
|
|||
case gpr_x26:
|
||||
case gpr_x27:
|
||||
case gpr_x28:
|
||||
case gpr_fp:
|
||||
case gpr_sp:
|
||||
case gpr_lr:
|
||||
case gpr_pc:
|
||||
case gpr_cpsr:
|
||||
value.SetUInt64(gpr.x[reg - gpr_x0]);
|
||||
break;
|
||||
case gpr_fp:
|
||||
value.SetUInt64(gpr.fp);
|
||||
break;
|
||||
case gpr_sp:
|
||||
value.SetUInt64(gpr.sp);
|
||||
break;
|
||||
case gpr_lr:
|
||||
value.SetUInt64(gpr.lr);
|
||||
break;
|
||||
case gpr_pc:
|
||||
value.SetUInt64(gpr.pc);
|
||||
break;
|
||||
case gpr_cpsr:
|
||||
value.SetUInt64(gpr.cpsr);
|
||||
break;
|
||||
|
||||
case gpr_w0:
|
||||
case gpr_w1:
|
||||
|
|
Loading…
Reference in New Issue