зеркало из https://github.com/microsoft/clang-1.git
Fix pascal string support; testcase from mailing list message.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68181 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
aec5cabee2
Коммит
57d7dde770
|
@ -863,12 +863,13 @@ StringLiteralParser(const Token *StringToks, unsigned NumStringToks,
|
|||
ResultBuf[0] = ResultPtr-&ResultBuf[0]-1;
|
||||
|
||||
// Verify that pascal strings aren't too large.
|
||||
if (GetStringLength() > 256)
|
||||
if (GetStringLength() > 256) {
|
||||
PP.Diag(StringToks[0].getLocation(), diag::err_pascal_string_too_long)
|
||||
<< SourceRange(StringToks[0].getLocation(),
|
||||
StringToks[NumStringToks-1].getLocation());
|
||||
hadError = 1;
|
||||
return;
|
||||
hadError = 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
// RUN: clang-cc -emit-llvm -o - %s -fpascal-strings | grep "05Hello"
|
||||
|
||||
unsigned char * Foo( void )
|
||||
{
|
||||
static unsigned char s[256] = "\pHello";
|
||||
return s;
|
||||
}
|
||||
|
Загрузка…
Ссылка в новой задаче