Don't read off end of the input array.

llvm-svn: 49799
This commit is contained in:
Dale Johannesen 2008-04-16 17:31:41 +00:00
parent 728d59166f
commit 87b88d2a8f

View File

@ -527,7 +527,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
Out << (unsigned char)(nibble + '0');
else
Out << (unsigned char)(nibble - 10 + 'A');
if (shiftcount == 0) {
if (shiftcount == 0 && j+4 < width) {
word = *(++p);
shiftcount = 64;
if (width-j-4 < 64)