diff --git a/lib/TableGen/Record.cpp b/lib/TableGen/Record.cpp index 43d178caef3..24251bc57f6 100644 --- a/lib/TableGen/Record.cpp +++ b/lib/TableGen/Record.cpp @@ -487,7 +487,7 @@ Init *IntInit::convertInitializerTo(RecTy *Ty) const { SmallVector NewBits(BRT->getNumBits()); for (unsigned i = 0; i != BRT->getNumBits(); ++i) - NewBits[i] = BitInit::get(Value & (1LL << i)); + NewBits[i] = BitInit::get(Value & ((i < 64) ? (1LL << i) : 0)); return BitsInit::get(NewBits); }