summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2008-05-30 11:13:18 +0000
committerEli Friedman <eli.friedman@gmail.com>2008-05-30 11:13:18 +0000
commit617ba48fd5731d1a5ffe21aa74cb74a5c886aeb6 (patch)
treef0c5c276e28dcbf7b22625bab5452ec3a223c137 /clang/lib/CodeGen/CodeGenModule.cpp
parentbf8d6cefdeca216017032b5da8f0cfe062cfed3f (diff)
downloadbcm5719-llvm-617ba48fd5731d1a5ffe21aa74cb74a5c886aeb6.tar.gz
bcm5719-llvm-617ba48fd5731d1a5ffe21aa74cb74a5c886aeb6.zip
Always check that the definition of a function has the correct type.
This fixes a crash on the included testcase (found in NetHack). llvm-svn: 51767
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index e5bd15e8566..43c7129010b 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -187,7 +187,7 @@ llvm::Constant *CodeGenModule::GetAddrOfFunctionDecl(const FunctionDecl *D,
bool isDefinition) {
// See if it is already in the map. If so, just return it.
llvm::Constant *&Entry = GlobalDeclMap[D];
- if (Entry) return Entry;
+ if (!isDefinition && Entry) return Entry;
const llvm::Type *Ty = getTypes().ConvertType(D->getType());
OpenPOWER on IntegriCloud