From 6aeb0474ca556061e2228edf4acbf5115d53c296 Mon Sep 17 00:00:00 2001 From: LADSoft Date: Fri, 2 Aug 2024 22:31:06 -0400 Subject: [PATCH] fix bug with debug info crash for dynamic startup sections --- src/olink/LinkDebugFile.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/olink/LinkDebugFile.cpp b/src/olink/LinkDebugFile.cpp index 39e4d1ac7..6afb8912a 100644 --- a/src/olink/LinkDebugFile.cpp +++ b/src/olink/LinkDebugFile.cpp @@ -754,10 +754,10 @@ bool LinkDebugFile::WriteAutosTable() case ObjDebugTag::eVirtualFunctionEnd: case ObjDebugTag::eBlockEnd: case ObjDebugTag::eFunctionEnd: { - - int end = currentLine->GetLineNumber(); + // currentLine could be null for example for the dynamic sections that aren't related to normal code gen... + int end = currentLine ? currentLine->GetLineNumber() : 0; // this next line is a safety, used to use start line - int fileId = currentLine->GetFile()->GetIndex(); + int fileId = currentLine ? currentLine->GetFile()->GetIndex() : 0; for (auto obj : currentContext->vars) { ObjSymbol* s = obj.first;