Support 'q' length modifier in scanf/printf interceptors

llvm-svn: 202268
This commit is contained in:
Alexey Samsonov 2014-02-26 14:42:38 +00:00
parent 4b1a7fe33a
commit 14e061d7cc
2 changed files with 3 additions and 0 deletions

View File

@ -116,6 +116,8 @@ static int format_get_value_size(char convSpecifier,
return lengthModifier[1] == 'h' ? sizeof(char) : sizeof(short);
case 'l':
return lengthModifier[1] == 'l' ? sizeof(long long) : sizeof(long);
case 'q':
return sizeof(long long);
case 'L':
return sizeof(long long);
case 'j':

View File

@ -111,6 +111,7 @@ TEST(SanitizerCommonInterceptors, Scanf) {
testScanf("ab%u%dc", 2, I, I);
testScanf("%ld", 1, L);
testScanf("%llu", 1, LL);
testScanf("%qd", 1, LL);
testScanf("a %hd%hhx", 2, S, C);
testScanf("%c", 1, C);