diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2008-05-30 11:13:18 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2008-05-30 11:13:18 +0000 |
commit | 109603de14dfe69f3eb9b264a273b38e5684c8de (patch) | |
tree | a135a97d949daa7b7da273b2ad7ae0197a867c45 /lib/CodeGen/CodeGenModule.cpp | |
parent | cc9b16394fe6c9245dc4f8661a63d0c3937b62f0 (diff) |
Always check that the definition of a function has the correct type.
This fixes a crash on the included testcase (found in NetHack).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51767 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index e5bd15e856..43c7129010 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/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()); |