forked from OSchip/llvm-project
Simplify assertion, and avoid undefined shift. Based on patch by Ahmed Charles.
llvm-svn: 141912
This commit is contained in:
parent
6bb41d9144
commit
a5abd03a8d
|
@ -98,14 +98,7 @@ public:
|
||||||
// Specifically ignore overflow/underflow as long as the leakage is
|
// Specifically ignore overflow/underflow as long as the leakage is
|
||||||
// limited to the lower bits. This is to remain compatible with
|
// limited to the lower bits. This is to remain compatible with
|
||||||
// other assemblers.
|
// other assemblers.
|
||||||
|
assert(isIntN(Size * 8 + 1, Value) &&
|
||||||
const uint64_t Mask = ~0ULL;
|
|
||||||
const uint64_t UpperV = (Value >> (Size * 8));
|
|
||||||
const uint64_t MaskF = (Mask >> (Size * 8));
|
|
||||||
(void)UpperV;
|
|
||||||
(void)MaskF;
|
|
||||||
assert(((Size == 8) ||
|
|
||||||
((UpperV & MaskF) == 0ULL) || ((UpperV & MaskF) == MaskF)) &&
|
|
||||||
"Value does not fit in the Fixup field");
|
"Value does not fit in the Fixup field");
|
||||||
|
|
||||||
for (unsigned i = 0; i != Size; ++i)
|
for (unsigned i = 0; i != Size; ++i)
|
||||||
|
|
Loading…
Reference in New Issue