From baae246fb8bf406ca6ac5a43dfa528bbc7690bbc Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Mon, 12 May 2014 20:59:57 +0000 Subject: [PATCH] Debug Info: Do not crash when the size of a piece cannot be determined. Swift SVN r17958 --- lib/IRGen/IRGenDebugInfo.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/IRGen/IRGenDebugInfo.cpp b/lib/IRGen/IRGenDebugInfo.cpp index 89cfb9b8b03..3b9df13107d 100644 --- a/lib/IRGen/IRGenDebugInfo.cpp +++ b/lib/IRGen/IRGenDebugInfo.cpp @@ -974,6 +974,8 @@ void IRGenDebugInfo::emitVariableDeclaration(IRBuilder& Builder, llvm::RoundUpToAlignment(Dim.Size, Dim.Align) / SizeOfByte; assert(Offset*8+Dim.Size<=Var.getSizeInBits(DIRefMap) && "pars > totum"); + if (Size == 0) + break; Var = DBuilder.createVariablePiece(Descriptor, Offset, Size); Offset += Size; }