mirror of
https://github.com/Gericom/teak-llvm.git
synced 2025-06-19 11:35:51 -04:00

argument to be memset, check for its type to be complete before calling Context.getTypeSize(PointeeTy) to prevent crash. // rdar://13081751. llvm-svn: 173872
16 lines
545 B
C
16 lines
545 B
C
// RUN: %clang_cc1 -fsyntax-only %s -verify
|
|
// rdar://13081751
|
|
|
|
typedef __SIZE_TYPE__ size_t;
|
|
void *memset(void*, int, size_t);
|
|
|
|
typedef struct __incomplete *incomplete;
|
|
|
|
void mt_query_for_domain(const char *domain)
|
|
{
|
|
incomplete query = 0;
|
|
memset(query, 0, sizeof(query)); // expected-warning {{'memset' call operates on objects of type 'struct __incomplete' while the size is based on a different type 'incomplete'}} \
|
|
// expected-note {{did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?}}
|
|
}
|
|
|