diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -219,7 +219,8 @@ /// Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. void MCStreamer::emitFill(uint64_t NumBytes, uint8_t FillValue) { - emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); + if (NumBytes != 0) + emitFill(*MCConstantExpr::create(NumBytes, getContext()), FillValue); } void llvm::MCStreamer::emitNops(int64_t NumBytes, int64_t ControlledNopLen,