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
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user