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

Fixed non-const 'this' check in const invocations

This commit is contained in:
Brian Fiete 2022-06-12 11:19:40 -07:00
parent 4c553ee9a3
commit 7aa2fdf976
2 changed files with 6 additions and 2 deletions

View file

@ -4911,7 +4911,11 @@ BfTypedValue CeContext::Call(CeCallSource callSource, BfModule* module, BfMethod
if (!isConst)
{
if ((argIdx != thisArgIdx) && (argIdx != appendAllocIdx))
if ((argIdx == thisArgIdx) && (methodInstance->mMethodDef->mMethodType == BfMethodType_Ctor))
{
// Allow non-const 'this' for ctor
}
else if (argIdx != appendAllocIdx)
{
Fail(StrFormat("Non-constant argument for param '%s'", methodInstance->GetParamName(paramIdx).c_str()));
return BfTypedValue();