[sanitizer] Treat \r, \n, \t as flag separators.

llvm-svn: 224858
This commit is contained in:
Evgeniy Stepanov 2014-12-26 16:09:15 +00:00
parent ef0f244594
commit 9e609426a7
2 changed files with 4 additions and 1 deletions

View File

@ -216,7 +216,7 @@ static bool GetFlagValue(const char *env, const char *name,
end = internal_strchr(pos, '\'');
} else {
// Read until the next space or colon.
end = pos + internal_strcspn(pos, " :");
end = pos + internal_strcspn(pos, " :\r\n\t");
}
if (end == 0)
end = pos + internal_strlen(pos);

View File

@ -81,6 +81,9 @@ TEST(SanitizerCommon, MultipleFlags) {
TestTwoFlags("flag2='qxx' flag1=0", false, "qxx");
TestTwoFlags("flag1=false:flag2='zzz'", false, "zzz");
TestTwoFlags("flag2=qxx:flag1=yes", true, "qxx");
TestTwoFlags("flag2=qxx\nflag1=yes", true, "qxx");
TestTwoFlags("flag2=qxx\r\nflag1=yes", true, "qxx");
TestTwoFlags("flag2=qxx\tflag1=yes", true, "qxx");
}
TEST(SanitizerCommon, CommonFlags) {