diff --git a/lib/MC/MCParser/AsmParser.cpp b/lib/MC/MCParser/AsmParser.cpp index c01f3acc661..aafc5e1850e 100644 --- a/lib/MC/MCParser/AsmParser.cpp +++ b/lib/MC/MCParser/AsmParser.cpp @@ -2612,7 +2612,8 @@ bool AsmParser::parseDirectiveFill() { for (uint64_t i = 0, e = NumValues; i != e; ++i) { getStreamer().EmitIntValue(FillExpr, NonZeroFillSize); - getStreamer().EmitIntValue(0, FillSize - NonZeroFillSize); + if (NonZeroFillSize < FillSize) + getStreamer().EmitIntValue(0, FillSize - NonZeroFillSize); } return false; diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp index e7ee9e481bf..914e3372670 100644 --- a/lib/MC/MCStreamer.cpp +++ b/lib/MC/MCStreamer.cpp @@ -72,7 +72,7 @@ void MCStreamer::generateCompactUnwindEncodings(MCAsmBackend *MAB) { /// EmitIntValue - Special case of EmitValue that avoids the client having to /// pass in a MCExpr for constant integers. void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size) { - assert(Size <= 8 && "Invalid size"); + assert(1 <= Size && Size <= 8 && "Invalid size"); assert((isUIntN(8 * Size, Value) || isIntN(8 * Size, Value)) && "Invalid size"); char buf[8];