[PATCH] D19334: [MC] EmitNop: Make an assertion more useful

Davide Italiano via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 20 10:59:13 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL266895: [MC] EmitNop: Make an assertion more useful. (authored by davide).

Changed prior to commit:
  http://reviews.llvm.org/D19334?vs=54391&id=54393#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19334

Files:
  llvm/trunk/lib/Target/X86/X86MCInstLower.cpp

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!");
   }
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19334.54393.patch
Type: text/x-patch
Size: 683 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160420/63dbcb7a/attachment.bin>


More information about the llvm-commits mailing list