summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorNate Begeman <natebegeman@mac.com>2008-04-09 16:24:11 +0000
committerNate Begeman <natebegeman@mac.com>2008-04-09 16:24:11 +0000
commit59d28132bcd68f882c526b043380c359ffc465e6 (patch)
treeacb2ed242ac57d5ca6b5e4dc1d7ea66574aa0960 /utils
parentd4e0af9f8945a1fb7b053f542ab114eb5908350d (diff)
downloadllvm-59d28132bcd68f882c526b043380c359ffc465e6.tar.gz
llvm-59d28132bcd68f882c526b043380c359ffc465e6.tar.bz2
llvm-59d28132bcd68f882c526b043380c359ffc465e6.tar.xz
Fix a bug where an incorrect bit mask would be generated if a target's last asm
string began at a power of 2 in the string index. For example, if "ret" started at position 16, the ret instruction would be assigned code 16, but the mask would be AsmChars[] + Code & 15, not Code & 31. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49433 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/AsmWriterEmitter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index 4ba22758a6..8fbb2cfbb6 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -536,7 +536,7 @@ void AsmWriterEmitter::run(std::ostream &O) {
}
// Figure out how many bits we used for the string index.
- unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx);
+ unsigned AsmStrBits = Log2_32_Ceil(MaxStringIdx+1);
// To reduce code size, we compactify common instructions into a few bits
// in the opcode-indexed table.