diff --git a/gen/functions.cpp b/gen/functions.cpp index c68a8cc250..39097d1c64 100644 --- a/gen/functions.cpp +++ b/gen/functions.cpp @@ -846,7 +846,8 @@ void DtoDefineFunction(FuncDeclaration* fd) // std::cout << *func << std::endl; // erase alloca point - allocaPoint->eraseFromParent(); + if (allocaPoint->getParent()) + allocaPoint->eraseFromParent(); allocaPoint = 0; gIR->func()->allocapoint = 0;