[compiler-rt] r202268 - Support 'q' length modifier in scanf/printf interceptors
Alexey Samsonov
samsonov at google.com
Wed Feb 26 06:42:38 PST 2014
Author: samsonov
Date: Wed Feb 26 08:42:38 2014
New Revision: 202268
URL: http://llvm.org/viewvc/llvm-project?rev=202268&view=rev
Log:
Support 'q' length modifier in scanf/printf interceptors
Modified:
compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc
Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_format.inc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_format.inc?rev=202268&r1=202267&r2=202268&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_format.inc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_common_interceptors_format.inc Wed Feb 26 08:42:38 2014
@@ -116,6 +116,8 @@ static int format_get_value_size(char co
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':
Modified: compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc?rev=202268&r1=202267&r2=202268&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/tests/sanitizer_format_interceptor_test.cc Wed Feb 26 08:42:38 2014
@@ -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);
More information about the llvm-commits
mailing list