mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 12:32:20 +02:00
Merge pull request #1018 from EinBurgbauer/comptime-crash-fixes
Comptime crash fixes
This commit is contained in:
commit
369bb0640c
1 changed files with 19 additions and 11 deletions
|
@ -2953,10 +2953,11 @@ 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))
|
||||
if ((moreInfo != NULL))
|
||||
{
|
||||
BfErrorLocation* location = new BfErrorLocation();
|
||||
location->mFile = ceFunction->mFiles[emitEntry->mFile];
|
||||
|
@ -2965,6 +2966,7 @@ BfError* CeContext::Fail(const CeFrame& curFrame, const StringImpl& str)
|
|||
moreInfo->mLocation = location;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bfError;
|
||||
}
|
||||
|
@ -4626,6 +4628,12 @@ bool CeContext::Execute(CeFunction* startFunction, uint8* startStackPtr, uint8*
|
|||
return false;
|
||||
}
|
||||
|
||||
if (paramIdx < 0 || paramIdx >= methodInstance->mParams.mSize)
|
||||
{
|
||||
_Fail("paramIdx is out of range");
|
||||
return false;
|
||||
}
|
||||
|
||||
addr_ce stringAddr = GetString(methodInstance->GetParamName(paramIdx));
|
||||
_FixVariables();
|
||||
*(int32*)(stackPtr + 0) = methodInstance->GetParamType(paramIdx)->mTypeId;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue