mirror of
https://github.com/beefytech/Beef.git
synced 2025-07-14 12:13:51 +02:00
Add null checks to comptime documentation
This commit is contained in:
parent
764c454261
commit
072e7ad1a9
1 changed files with 6 additions and 3 deletions
|
@ -6460,6 +6460,7 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
||||||
|
|
||||||
String str;
|
String str;
|
||||||
if (auto typeInst = type->ToTypeInstance())
|
if (auto typeInst = type->ToTypeInstance())
|
||||||
|
if(typeInst->mTypeDef->mTypeDeclaration->mDocumentation != NULL)
|
||||||
typeInst->mTypeDef->mTypeDeclaration->mDocumentation->GetDocString(str);
|
typeInst->mTypeDef->mTypeDeclaration->mDocumentation->GetDocString(str);
|
||||||
|
|
||||||
SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCeMachine->mCeModule->mCurMethodInstance, mCallerMethodInstance);
|
SetAndRestoreValue<BfMethodInstance*> prevMethodInstance(mCeMachine->mCeModule->mCurMethodInstance, mCallerMethodInstance);
|
||||||
|
@ -6704,6 +6705,7 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
||||||
|
|
||||||
String docs;
|
String docs;
|
||||||
if (auto decl = BfNodeDynCast<BfMethodDeclaration>(methodInstance->mMethodDef->mMethodDeclaration))
|
if (auto decl = BfNodeDynCast<BfMethodDeclaration>(methodInstance->mMethodDef->mMethodDeclaration))
|
||||||
|
if(decl->mDocumentation != NULL)
|
||||||
decl->mDocumentation->GetDocString(docs);
|
decl->mDocumentation->GetDocString(docs);
|
||||||
|
|
||||||
CeSetAddrVal(stackPtr + 0, GetString(docs), ptrSize);
|
CeSetAddrVal(stackPtr + 0, GetString(docs), ptrSize);
|
||||||
|
@ -6829,6 +6831,7 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
||||||
}
|
}
|
||||||
auto fieldInstance = typeInst->mFieldInstances[fieldIdx];
|
auto fieldInstance = typeInst->mFieldInstances[fieldIdx];
|
||||||
if (auto decl = BfNodeDynCast<BfFieldDeclaration>(fieldInstance.GetFieldDef()->mFieldDeclaration))
|
if (auto decl = BfNodeDynCast<BfFieldDeclaration>(fieldInstance.GetFieldDef()->mFieldDeclaration))
|
||||||
|
if(decl->mDocumentation != NULL)
|
||||||
decl->mDocumentation->GetDocString(docs);
|
decl->mDocumentation->GetDocString(docs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue