forked from OSchip/llvm-project
Fix one last place where we weren't writing into a string literal consistently.
llvm-svn: 143769
This commit is contained in:
parent
5b08d9adf5
commit
20554708fb
|
@ -1112,8 +1112,20 @@ void StringLiteralParser::init(const Token *StringToks, unsigned NumStringToks){
|
|||
}
|
||||
|
||||
if (Pascal) {
|
||||
ResultBuf[0] = ResultPtr-&ResultBuf[0]-1;
|
||||
ResultBuf[0] /= CharByteWidth;
|
||||
if (CharByteWidth == 4) {
|
||||
// FIXME: Make the type of the result buffer correct instead of
|
||||
// using reinterpret_cast.
|
||||
UTF32 *ResultWidePtr = reinterpret_cast<UTF32*>(ResultBuf.data());
|
||||
ResultWidePtr[0] = GetNumStringChars() - 1;
|
||||
} else if (CharByteWidth == 2) {
|
||||
// FIXME: Make the type of the result buffer correct instead of
|
||||
// using reinterpret_cast.
|
||||
UTF16 *ResultWidePtr = reinterpret_cast<UTF16*>(ResultBuf.data());
|
||||
ResultWidePtr[0] = GetNumStringChars() - 1;
|
||||
} else {
|
||||
assert(CharByteWidth == 1 && "Unexpected char width");
|
||||
ResultBuf[0] = GetNumStringChars() - 1;
|
||||
}
|
||||
|
||||
// Verify that pascal strings aren't too large.
|
||||
if (GetStringLength() > 256) {
|
||||
|
|
Loading…
Reference in New Issue