forked from OSchip/llvm-project
Fix off-by-one error in StringLiteral::getLocationOfByte.
This fixes PR10223. llvm-svn: 134183
This commit is contained in:
parent
b10a0f223a
commit
77d1abef07
|
@ -593,7 +593,7 @@ getLocationOfByte(unsigned ByteNo, const SourceManager &SM,
|
|||
|
||||
// If the byte is in this token, return the location of the byte.
|
||||
if (ByteNo < TokNumBytes ||
|
||||
(ByteNo == TokNumBytes && TokNo == getNumConcatenated())) {
|
||||
(ByteNo == TokNumBytes && TokNo == getNumConcatenated() - 1)) {
|
||||
unsigned Offset = SLP.getOffsetOfStringByte(TheTok, ByteNo);
|
||||
|
||||
// Now that we know the offset of the token in the spelling, use the
|
||||
|
|
|
@ -117,3 +117,9 @@ void test11(void) {
|
|||
void test12(void) {
|
||||
register int cc __asm ("cc"); // expected-error{{unknown register name 'cc' in asm}}
|
||||
}
|
||||
|
||||
// PR10223
|
||||
void test13(void) {
|
||||
void *esp;
|
||||
__asm__ volatile ("mov %%esp, %o" : "=r"(esp) : : ); // expected-error {{invalid % escape in inline assembly string}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue