x86: fix issue with casting in Cvtf2i
UBSAN flags this operation because it detects that arg is being cast directly to an unsigned type, argBits. this patch fixes this by first casting the value to a signed int type, then reintrepreting the raw bits of the signed int into argBits.
This commit is contained in:
parent
29d38e7576
commit
0799600686
1 changed files with 4 additions and 2 deletions
|
@ -1220,9 +1220,11 @@ let {{
|
||||||
}
|
}
|
||||||
|
|
||||||
if (destSize == 4) {
|
if (destSize == 4) {
|
||||||
argBits = (uint32_t)arg;
|
int32_t i_arg = (int32_t)arg;
|
||||||
|
argBits = *((uint32_t*)&i_arg);
|
||||||
} else {
|
} else {
|
||||||
argBits = (uint64_t)arg;
|
int64_t i_arg = (int64_t)arg;
|
||||||
|
argBits = *((uint64_t*)&i_arg);
|
||||||
}
|
}
|
||||||
int destHiIndex = destStart + (i + 1) * destSizeBits - 1;
|
int destHiIndex = destStart + (i + 1) * destSizeBits - 1;
|
||||||
int destLoIndex = destStart + (i + 0) * destSizeBits;
|
int destLoIndex = destStart + (i + 0) * destSizeBits;
|
||||||
|
|
Loading…
Reference in a new issue