forked from OSchip/llvm-project
[analyzer] __mempcpy_chk is the same as mempcpy (at least to CStringChecker)
llvm-svn: 132605
This commit is contained in:
parent
205c7d559f
commit
aee7fb9e64
|
@ -1237,7 +1237,7 @@ bool CStringChecker::evalCall(const CallExpr *CE, CheckerContext &C) const {
|
|||
|
||||
FnCheck evalFunction = llvm::StringSwitch<FnCheck>(Name)
|
||||
.Cases("memcpy", "__memcpy_chk", &CStringChecker::evalMemcpy)
|
||||
.Case("mempcpy", &CStringChecker::evalMempcpy)
|
||||
.Cases("mempcpy", "__mempcpy_chk", &CStringChecker::evalMempcpy)
|
||||
.Cases("memcmp", "bcmp", &CStringChecker::evalMemcmp)
|
||||
.Cases("memmove", "__memmove_chk", &CStringChecker::evalMemmove)
|
||||
.Cases("strcpy", "__strcpy_chk", &CStringChecker::evalStrcpy)
|
||||
|
|
|
@ -140,9 +140,22 @@ void memcpy13() {
|
|||
// mempcpy()
|
||||
//===----------------------------------------------------------------------===
|
||||
|
||||
#ifdef VARIANT
|
||||
|
||||
#define __mempcpy_chk BUILTIN(__mempcpy_chk)
|
||||
void *__mempcpy_chk(void *restrict s1, const void *restrict s2, size_t n,
|
||||
size_t destlen);
|
||||
|
||||
#define mempcpy(a,b,c) __mempcpy_chk(a,b,c,(size_t)-1)
|
||||
|
||||
#else /* VARIANT */
|
||||
|
||||
#define mempcpy BUILTIN(mempcpy)
|
||||
void *mempcpy(void *restrict s1, const void *restrict s2, size_t n);
|
||||
|
||||
#endif /* VARIANT */
|
||||
|
||||
|
||||
void mempcpy0 () {
|
||||
char src[] = {1, 2, 3, 4};
|
||||
char dst[5] = {0};
|
||||
|
|
Loading…
Reference in New Issue