mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-08 19:48:20 +02:00
handle ce fail mFile index of -1
This commit is contained in:
parent
d7f0c6523d
commit
55c83d7076
1 changed files with 12 additions and 10 deletions
|
@ -2951,19 +2951,21 @@ BfError* CeContext::Fail(const CeFrame& curFrame, const StringImpl& str)
|
|||
err += mCeMachine->mCeModule->MethodToString(ceFunction->mCeInnerFunctionInfo->mOwner->mMethodInstance, BfMethodNameFlag_OmitParams);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bfError;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue