Index: llvm/trunk/lib/Target/X86/X86MCInstLower.cpp =================================================================== --- llvm/trunk/lib/Target/X86/X86MCInstLower.cpp +++ llvm/trunk/lib/Target/X86/X86MCInstLower.cpp @@ -837,9 +837,10 @@ /// \brief Emit the optimal amount of multi-byte nops on X86. static void EmitNops(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, const MCSubtargetInfo &STI) { + unsigned NopsToEmit = NumBytes; while (NumBytes) { NumBytes -= EmitNop(OS, NumBytes, Is64Bit, STI); - assert(NumBytes >= 0 && "Emitted more than I asked for!"); + assert(NopsToEmit >= NumBytes && "Emitted more than I asked for!"); } }