aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2010-12-15 07:12:24 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2010-12-15 07:12:24 +0000
commitb35d56c2fe39064a33d0e4e7faf5464b6d8a7352 (patch)
tree4bc453b9baed22e72cc209025c4f83ea13aa3cd4 /lib/MC/MCStreamer.cpp
parentef17f08dbc3897f6826c593e27619383dda1035a (diff)
downloadexternal_llvm-b35d56c2fe39064a33d0e4e7faf5464b6d8a7352.zip
external_llvm-b35d56c2fe39064a33d0e4e7faf5464b6d8a7352.tar.gz
external_llvm-b35d56c2fe39064a33d0e4e7faf5464b6d8a7352.tar.bz2
Generalize an assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121851 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r--lib/MC/MCStreamer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 6f9692d..fc7a754 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -48,7 +48,8 @@ void MCStreamer::EmitDwarfSetLineAddr(int64_t LineDelta,
void MCStreamer::EmitIntValue(uint64_t Value, unsigned Size,
unsigned AddrSpace) {
assert(Size <= 8 && "Invalid size");
- assert(!(Size == 1 && (signed)Value > 255) && "Invalid size");
+ unsigned Bits = 8 * Size;
+ assert((isUIntN(Bits, Value) || isIntN(Bits, Value)) && "Invalid size");
char buf[8];
// FIXME: Endianness assumption.
for (unsigned i = 0; i != Size; ++i)