summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/unknown-anytype.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-11-11 16:56:21 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-11-11 16:56:21 +0000
commitd45e22102f8702a5280f100ebf0c503d65590321 (patch)
treef659f7d69dbeca02c27afb68e41ab10a39d2ca7b /test/CodeGenCXX/unknown-anytype.cpp
parent3b5935e251c9207fe3540d64398917cc37994be5 (diff)
This patch fixes a crash after rebuilding call AST of
an __unknown_anytype(...). In this case, we rebuild the vararg function type specially to convert the call expression to something that IRGen can handle. However, FunctionDecl as rebuilt in RebuildUnknownAnyExpr::resolveDecl is bogus and results in crash when accessing its params later on. This patch fixes the crash by rebuilding the FunctionDecl to match its new resolved type. rdar://15297105. (patch reapplied after lldb issue was fixed in r221660). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221691 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/unknown-anytype.cpp')
-rw-r--r--test/CodeGenCXX/unknown-anytype.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/CodeGenCXX/unknown-anytype.cpp b/test/CodeGenCXX/unknown-anytype.cpp
index aacb8493ef..c1b8c7df70 100644
--- a/test/CodeGenCXX/unknown-anytype.cpp
+++ b/test/CodeGenCXX/unknown-anytype.cpp
@@ -115,3 +115,9 @@ extern "C" __unknown_anytype test10_any(...);
void test10() {
(void) test10_any(), (void) test10_any();
}
+
+extern "C" __unknown_anytype malloc(...);
+void test11() {
+ void *s = (void*)malloc(12);
+ void *d = (void*)malloc(435);
+}