Validate DiagGroup names in TableGen, they're used as command line arguments so we don't want shell meta chars in there.
llvm-svn: 144645
This commit is contained in:
parent
176a5cb38a
commit
fee467a0d0
|
@ -303,6 +303,10 @@ void ClangDiagGroupsEmitter::run(raw_ostream &OS) {
|
|||
OS << " { ";
|
||||
OS << I->first.size() << ", ";
|
||||
OS << "\"";
|
||||
if (I->first.find_first_not_of("abcdefghijklmnopqrstuvwxyz"
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"0123456789!@#$%^*-+=:?")!=std::string::npos)
|
||||
throw "Invalid character in diagnostic group '" + I->first + "'";
|
||||
OS.write_escaped(I->first) << "\","
|
||||
<< std::string(MaxLen-I->first.size()+1, ' ');
|
||||
|
||||
|
|
Loading…
Reference in New Issue