This will never happen in the analyzed code code, but can happen for checkers
that over-eagerly dereference pointers without checking that it's safe.
UnknownVal is a harmless enough value to get back.
Fixes an issue added in r189590, caught by our internal buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@189688
91177308-0d34-0410-b5e6-
96231b3b80d8
SVal RegionStoreManager::getBindingForStruct(RegionBindingsConstRef B,
const TypedValueRegion *R) {
const RecordDecl *RD = R->getValueType()->castAs<RecordType>()->getDecl();
- if (isRecordEmpty(RD))
+ if (!RD->getDefinition() || isRecordEmpty(RD))
return UnknownVal();
return createLazyBinding(B, R);
extern FILE *stdin;
typedef long ssize_t;
ssize_t getline(char ** __restrict, size_t * __restrict, FILE * __restrict);
-int printf(const char * __restrict, ...);
+int printf(const char * __restrict, ...);
+int snprintf(char *, size_t, const char *, ...);
void free(void *ptr);
struct GetLineTestStruct {
}
free(line);
}
+
+class opaque;
+void testOpaqueClass(opaque *obj) {
+ char buf[20];
+ snprintf(buf, 20, "%p", obj); // don't crash trying to load *obj
+}
+