зеркало из https://github.com/microsoft/clang-1.git
Patch from Argiris Kirtzidis:
The patch fixes some debug assertions that the msvcrt throws: 1) - if (isprint(value) && value < 256) { + if (value < 256 && isprint(value)) { isprint() does an assertion check of its own for value < 256; check value before calling it to prevent it. 2) - Stmt->Names.push_back(std::string(&data[0], data.size())); + if (data.size() == 0) + Stmt->Names.push_back(std::string()); + else + Stmt->Names.push_back(std::string(&data[0], data.size())); If data.size() == 0 then data[0] throws "out of range" assertion. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47512 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
d156d536e1
Коммит
471733d846
|
@ -536,7 +536,7 @@ void StmtPrinter::VisitCharacterLiteral(CharacterLiteral *Node) {
|
||||||
OS << "'\\v'";
|
OS << "'\\v'";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (isprint(value) && value < 256) {
|
if (value < 256 && isprint(value)) {
|
||||||
OS << "'" << (char)value << "'";
|
OS << "'" << (char)value << "'";
|
||||||
} else if (value < 256) {
|
} else if (value < 256) {
|
||||||
OS << "'\\x" << std::hex << value << std::dec << "'";
|
OS << "'\\x" << std::hex << value << std::dec << "'";
|
||||||
|
|
|
@ -270,7 +270,10 @@ AsmStmt* AsmStmt::CreateImpl(Deserializer& D) {
|
||||||
std::vector<char> data;
|
std::vector<char> data;
|
||||||
D.ReadCStr(data, false);
|
D.ReadCStr(data, false);
|
||||||
|
|
||||||
Stmt->Names.push_back(std::string(&data[0], data.size()));
|
if (data.size() == 0)
|
||||||
|
Stmt->Names.push_back(std::string());
|
||||||
|
else
|
||||||
|
Stmt->Names.push_back(std::string(&data[0], data.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
Stmt->Constraints.reserve(size);
|
Stmt->Constraints.reserve(size);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче