1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-09 03:52:19 +02:00

handle ce fail mFile index of -1

This commit is contained in:
EinBurgbauer 2021-05-18 11:06:40 +02:00
parent d7f0c6523d
commit 55c83d7076

View file

@ -2953,10 +2953,11 @@ BfError* CeContext::Fail(const CeFrame& curFrame, const StringImpl& str)
} }
if ((emitEntry != NULL) && (emitEntry->mFile != -1)) if ((emitEntry != NULL) && (emitEntry->mFile != -1))
{
err += StrFormat(" at line% d:%d in %s", emitEntry->mLine + 1, emitEntry->mColumn + 1, ceFunction->mFiles[emitEntry->mFile].c_str()); err += StrFormat(" at line% d:%d in %s", emitEntry->mLine + 1, emitEntry->mColumn + 1, ceFunction->mFiles[emitEntry->mFile].c_str());
auto moreInfo = passInstance->MoreInfo(err, mCeMachine->mCeModule->mCompiler->GetAutoComplete() != NULL); auto moreInfo = passInstance->MoreInfo(err, mCeMachine->mCeModule->mCompiler->GetAutoComplete() != NULL);
if ((moreInfo != NULL) && (emitEntry != NULL)) if ((moreInfo != NULL))
{ {
BfErrorLocation* location = new BfErrorLocation(); BfErrorLocation* location = new BfErrorLocation();
location->mFile = ceFunction->mFiles[emitEntry->mFile]; location->mFile = ceFunction->mFiles[emitEntry->mFile];
@ -2965,6 +2966,7 @@ BfError* CeContext::Fail(const CeFrame& curFrame, const StringImpl& str)
moreInfo->mLocation = location; moreInfo->mLocation = location;
} }
} }
}
return bfError; return bfError;
} }