Handle disgusting corner case where a byte is loaded from the address of a function.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78000 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/Analysis/misc-ps.m b/test/Analysis/misc-ps.m
index c4fa7a8..5cfcd71 100644
--- a/test/Analysis/misc-ps.m
+++ b/test/Analysis/misc-ps.m
@@ -499,3 +499,12 @@
char *p = &x[1];
const void* q = p;
}
+
+// Reduced from a crash when analyzing Wine. This test handles loads from
+// function addresses.
+typedef long (*FARPROC)();
+FARPROC test_load_func(FARPROC origfun) {
+ if (!*(unsigned char*) origfun)
+ return origfun;
+ return 0;
+}