mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-02-07 01:47:09 +00:00
[Hexagon] Perform bit arithmetic on unsigned to avoid accidentally shifting negative values.
Found by ubsan. llvm-svn: 277268
This commit is contained in:
parent
96cb6bfa27
commit
afff73cb5a
@ -2047,8 +2047,8 @@ bool HexagonConstEvaluator::evaluate(const MachineInstr &MI,
|
||||
case Hexagon::A2_combineii: // combine(#s8Ext, #s8)
|
||||
case Hexagon::A4_combineii: // combine(#s8, #u6Ext)
|
||||
{
|
||||
int64_t Hi = MI.getOperand(1).getImm();
|
||||
int64_t Lo = MI.getOperand(2).getImm();
|
||||
uint64_t Hi = MI.getOperand(1).getImm();
|
||||
uint64_t Lo = MI.getOperand(2).getImm();
|
||||
uint64_t Res = (Hi << 32) | (Lo & 0xFFFFFFFF);
|
||||
IntegerType *Ty = Type::getInt64Ty(CX);
|
||||
const ConstantInt *CI = ConstantInt::get(Ty, Res, false);
|
||||
|
Loading…
x
Reference in New Issue
Block a user