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,16 +2953,18 @@ BfError* CeContext::Fail(const CeFrame& curFrame, const StringImpl& str)
}
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());
auto moreInfo = passInstance->MoreInfo(err, mCeMachine->mCeModule->mCompiler->GetAutoComplete() != NULL);
if ((moreInfo != NULL) && (emitEntry != NULL))
{
BfErrorLocation* location = new BfErrorLocation();
location->mFile = ceFunction->mFiles[emitEntry->mFile];
location->mLine = emitEntry->mLine;
location->mColumn = emitEntry->mColumn;
moreInfo->mLocation = location;
auto moreInfo = passInstance->MoreInfo(err, mCeMachine->mCeModule->mCompiler->GetAutoComplete() != NULL);
if ((moreInfo != NULL))
{
BfErrorLocation* location = new BfErrorLocation();
location->mFile = ceFunction->mFiles[emitEntry->mFile];
location->mLine = emitEntry->mLine;
location->mColumn = emitEntry->mColumn;
moreInfo->mLocation = location;
}
}
}