1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-07-14 20:23:51 +02:00

Merge pull request #2285 from Booklordofthedings/master

Add null checks to comptime documentation
This commit is contained in:
Brian Fiete 2025-07-11 03:52:52 -07:00 committed by GitHub
commit 6d40d96cbc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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<BfMethodInstance*> prevMethodInstance(mCeMachine->mCeModule->mCurMethodInstance, mCallerMethodInstance);
SetAndRestoreValue<BfTypeInstance*> prevTypeInstance(mCeMachine->mCeModule->mCurTypeInstance, mCallerTypeInstance);
@ -6704,7 +6705,8 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
String docs;
if (auto decl = BfNodeDynCast<BfMethodDeclaration>(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<BfFieldDeclaration>(fieldInstance.GetFieldDef()->mFieldDeclaration))
decl->mDocumentation->GetDocString(docs);
if(decl->mDocumentation != NULL)
decl->mDocumentation->GetDocString(docs);
}
}