summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/cstring-syntax.c
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2017-02-02 08:20:54 +0000
committerGabor Horvath <xazax.hun@gmail.com>2017-02-02 08:20:54 +0000
commit3b008536f3c8d398f4359f4c47e4a9721b11ad08 (patch)
tree6acd721c5d010e9617b3702e87493cdfcebf01f9 /clang/test/Analysis/cstring-syntax.c
parent047a8be18af9f35efac8479a77e65defe5c908ae (diff)
downloadbcm5719-llvm-3b008536f3c8d398f4359f4c47e4a9721b11ad08.tar.gz
bcm5719-llvm-3b008536f3c8d398f4359f4c47e4a9721b11ad08.zip
[analyzer] Fix an assertion fail in CStringSyntaxChecker.
Differential Revision: https://reviews.llvm.org/D29384 llvm-svn: 293874
Diffstat (limited to 'clang/test/Analysis/cstring-syntax.c')
-rw-r--r--clang/test/Analysis/cstring-syntax.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/test/Analysis/cstring-syntax.c b/clang/test/Analysis/cstring-syntax.c
index 4aa88ed3b7e..2cde0139c20 100644
--- a/clang/test/Analysis/cstring-syntax.c
+++ b/clang/test/Analysis/cstring-syntax.c
@@ -10,4 +10,6 @@ void testStrncat(const char *src) {
strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest)); // expected-warning {{Potential buffer overflow. Replace with}}
strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(dest) - strlen(dest)); // expected-warning {{Potential buffer overflow. Replace with}}
strncat(dest, src, sizeof(src)); // expected-warning {{Potential buffer overflow. Replace with}}
+ // Should not crash when sizeof has a type argument.
+ strncat(dest, "AAAAAAAAAAAAAAAAAAAAAAAAAAA", sizeof(char));
}
OpenPOWER on IntegriCloud