summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2010-11-15 20:09:42 +0000
committerTed Kremenek <kremenek@apple.com>2010-11-15 20:09:42 +0000
commitdb73d599b78cf2e0570b2e200e7ded729ebefb1b (patch)
tree79ee9099a23b0478f5efbee7aeba6c30fbfc2e23 /clang/test/Analysis
parent2a3c22efbab97574b4d93bd19c58655224d6a55a (diff)
downloadbcm5719-llvm-db73d599b78cf2e0570b2e200e7ded729ebefb1b.tar.gz
bcm5719-llvm-db73d599b78cf2e0570b2e200e7ded729ebefb1b.zip
Relax assertion in SValuator so that we don't crash when analyzing a call via a function pointer that
casts the return value to something completely different. While we need better reasoning here, we should definately not crash. llvm-svn: 119177
Diffstat (limited to 'clang/test/Analysis')
-rw-r--r--clang/test/Analysis/misc-ps.m10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/misc-ps.m b/clang/test/Analysis/misc-ps.m
index 9b923bf0f80..902bfb6aae1 100644
--- a/clang/test/Analysis/misc-ps.m
+++ b/clang/test/Analysis/misc-ps.m
@@ -1193,3 +1193,13 @@ void pr5272_test() {
(*(struct pr5272*)0xBC000000).var2 += 2; // no-warning
}
+// Support casting the return value of function to another different type
+// This previously caused a crash, although we likely need more precise
+// reasoning here. <rdar://problem/8663544>
+void* rdar8663544();
+typedef struct {} Val8663544;
+Val8663544 bazR8663544() {
+ Val8663544(*func) () = (Val8663544(*) ()) rdar8663544;
+ return func();
+}
+
OpenPOWER on IntegriCloud