From: Davide Italiano Date: Wed, 20 Apr 2016 17:53:21 +0000 (+0000) Subject: [MC] EmitNop: Make an assertion more useful. X-Git-Tag: llvmorg-3.9.0-rc1~8565 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8a8f24b098c9d984f6155411605b0d5120e3f9d6;p=platform%2Fupstream%2Fllvm.git [MC] EmitNop: Make an assertion more useful. Differential Revision: http://reviews.llvm.org/D19334 llvm-svn: 266895 --- diff --git a/llvm/lib/Target/X86/X86MCInstLower.cpp b/llvm/lib/Target/X86/X86MCInstLower.cpp index 6a5e97b..6b42943 100644 --- a/llvm/lib/Target/X86/X86MCInstLower.cpp +++ b/llvm/lib/Target/X86/X86MCInstLower.cpp @@ -837,9 +837,10 @@ static unsigned EmitNop(MCStreamer &OS, unsigned NumBytes, bool Is64Bit, /// \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!"); } }