From 16b0fe136e362d32f9366ad23c3832b8afe5a47b Mon Sep 17 00:00:00 2001 From: Alexey Prokhin Date: Fri, 31 Dec 2010 14:07:33 +0300 Subject: [PATCH] Fixed a crash in DtoDefineFunction. --- gen/functions.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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;