summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/cast-to-struct.cpp
diff options
context:
space:
mode:
authorDaniel Marjamaki <daniel.marjamaki@evidente.se>2017-02-18 11:18:57 +0000
committerDaniel Marjamaki <daniel.marjamaki@evidente.se>2017-02-18 11:18:57 +0000
commit1149166bb9d198b73d28bf678abc1cd05b8a7416 (patch)
treee998979821bb9559626e2d3b1a13530da62a09f5 /clang/test/Analysis/cast-to-struct.cpp
parent93748ebf829623daebf0b5f4e983823894a95d21 (diff)
downloadbcm5719-llvm-1149166bb9d198b73d28bf678abc1cd05b8a7416.tar.gz
bcm5719-llvm-1149166bb9d198b73d28bf678abc1cd05b8a7416.zip
[analyzer] Fix crash in CastToStruct when there is no record definition
This crash was reported in https://bugs.llvm.org//show_bug.cgi?id=31173 Differential Revision: https://reviews.llvm.org/D28297 llvm-svn: 295545
Diffstat (limited to 'clang/test/Analysis/cast-to-struct.cpp')
-rw-r--r--clang/test/Analysis/cast-to-struct.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/test/Analysis/cast-to-struct.cpp b/clang/test/Analysis/cast-to-struct.cpp
index 45d55947c93..6c23c2bf48d 100644
--- a/clang/test/Analysis/cast-to-struct.cpp
+++ b/clang/test/Analysis/cast-to-struct.cpp
@@ -65,3 +65,8 @@ void intToStruct(int *P) {
void *VP = P;
Abc = (struct ABC *)VP;
}
+
+// https://llvm.org/bugs/show_bug.cgi?id=31173
+void dontCrash(struct AB X) {
+ struct UndefS *S = (struct UndefS *)&X;
+}
OpenPOWER on IntegriCloud