forked from OSchip/llvm-project
[PowerPC] Fix transform in table gen file causing UB
Running a bootstrap build with UBSan produces a number of instances where we have signed integer overflow due to this transform. Change the type to long to prevent this UB on 64-bit build machines. llvm-svn: 325347
This commit is contained in:
parent
e44533b7f1
commit
6cf41b028d
|
@ -308,7 +308,7 @@ def HI16 : SDNodeXForm<imm, [{
|
|||
|
||||
def HA16 : SDNodeXForm<imm, [{
|
||||
// Transformation function: shift the immediate value down into the low bits.
|
||||
int Val = N->getZExtValue();
|
||||
long Val = N->getZExtValue();
|
||||
return getI32Imm((Val - (signed short)Val) >> 16, SDLoc(N));
|
||||
}]>;
|
||||
def MB : SDNodeXForm<imm, [{
|
||||
|
|
Loading…
Reference in New Issue