diff --git a/gen/llvmhelpers.cpp b/gen/llvmhelpers.cpp index d7170fe3..0819f2ed 100644 --- a/gen/llvmhelpers.cpp +++ b/gen/llvmhelpers.cpp @@ -1916,7 +1916,8 @@ DValue* DtoSymbolAddress(const Loc& loc, Type* type, Declaration* decl) fatal(); } DtoResolveFunction(fdecl); - return new DFuncValue(fdecl, fdecl->ir.irFunc->func); + assert(fdecl->llvmInternal == LLVMva_arg || fdecl->ir.irFunc); + return new DFuncValue(fdecl, fdecl->ir.irFunc ? fdecl->ir.irFunc->func : 0); } if (SymbolDeclaration* sdecl = decl->isSymbolDeclaration()) @@ -2028,4 +2029,4 @@ FuncDeclaration* getParentFunc(Dsymbol* sym, bool stopOnStatic) { } return (parent ? parent->isFuncDeclaration() : NULL); -} \ No newline at end of file +}