From 072e7ad1a9ab115c5afcd3fa6083caa34d7489de Mon Sep 17 00:00:00 2001 From: Booklordofthedings Date: Mon, 7 Jul 2025 22:14:10 +0200 Subject: [PATCH] Add null checks to comptime documentation --- IDEHelper/Compiler/CeMachine.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/IDEHelper/Compiler/CeMachine.cpp b/IDEHelper/Compiler/CeMachine.cpp index 826823a6..bb8c5a0f 100644 --- a/IDEHelper/Compiler/CeMachine.cpp +++ b/IDEHelper/Compiler/CeMachine.cpp @@ -6460,7 +6460,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* String str; if (auto typeInst = type->ToTypeInstance()) - typeInst->mTypeDef->mTypeDeclaration->mDocumentation->GetDocString(str); + if(typeInst->mTypeDef->mTypeDeclaration->mDocumentation != NULL) + typeInst->mTypeDef->mTypeDeclaration->mDocumentation->GetDocString(str); SetAndRestoreValue prevMethodInstance(mCeMachine->mCeModule->mCurMethodInstance, mCallerMethodInstance); SetAndRestoreValue prevTypeInstance(mCeMachine->mCeModule->mCurTypeInstance, mCallerTypeInstance); @@ -6704,7 +6705,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* String docs; if (auto decl = BfNodeDynCast(methodInstance->mMethodDef->mMethodDeclaration)) - decl->mDocumentation->GetDocString(docs); + if(decl->mDocumentation != NULL) + decl->mDocumentation->GetDocString(docs); CeSetAddrVal(stackPtr + 0, GetString(docs), ptrSize); _FixVariables(); @@ -6829,7 +6831,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8* } auto fieldInstance = typeInst->mFieldInstances[fieldIdx]; if (auto decl = BfNodeDynCast(fieldInstance.GetFieldDef()->mFieldDeclaration)) - decl->mDocumentation->GetDocString(docs); + if(decl->mDocumentation != NULL) + decl->mDocumentation->GetDocString(docs); } }