[analyzer] PR41185: Fix regression where __builtin_* functions weren't recognized
authorKristof Umann <kristof.umann@ericsson.com>
Wed, 17 Apr 2019 19:56:40 +0000 (19:56 +0000)
committerKristof Umann <kristof.umann@ericsson.com>
Wed, 17 Apr 2019 19:56:40 +0000 (19:56 +0000)
commit25e592e52236669f72bfb54986c1197cc6b640cf
treece581b3ed5d2182bbf404d5ef56652d21bbaca7b
parent7a5eae15a14677c594475cf88934a00f00da870a
[analyzer] PR41185: Fix regression where __builtin_* functions weren't recognized

For the following code snippet:

void builtin_function_call_crash_fixes(char *c) {
  __builtin_strncpy(c, "", 6);
  __builtin_memset(c, '\0', (0));
  __builtin_memcpy(c, c, 0);
}
security.insecureAPI.DeprecatedOrUnsafeBufferHandling caused a regression, as it
didn't recognize functions starting with __builtin_. Fixed exactly that.

I wanted to modify an existing test file, but the two I found didn't seem like
perfect candidates. While I was there, I prettified their RUN: lines.

Differential Revision: https://reviews.llvm.org/D59812

llvm-svn: 358609
clang/lib/StaticAnalyzer/Checkers/CheckSecuritySyntaxOnly.cpp
clang/test/Analysis/security-syntax-checks-no-emit.c
clang/test/Analysis/security-syntax-checks.c [new file with mode: 0644]
clang/test/Analysis/security-syntax-checks.m