s390_insert_operand ()'s val, min and max are encoded PCRel32 values
and need to be left-shifted by 1 before being shown to the user.
Left-shifting negative values is undefined behavior in C, but the
current code does not try to prevent it, causing UBSan to complain.
Fix by casting the values to their unsigned equivalents before
shifting.
if (operand->flags & S390_OPERAND_PCREL)
{
- val <<= 1;
- min <<= 1;
- max <<= 1;
+ val = (offsetT) ((addressT) val << 1);
+ min = (offsetT) ((addressT) min << 1);
+ max = (offsetT) ((addressT) max << 1);
}
if (file == (char *) NULL)
as_bad (err, (int64_t) val, (int64_t) min, (int64_t) max);