- marked all places where an incomplete parameter list may be passed to the VM by a native call by redirecting VMCall to an intermediate VMCallWithDefaults. This function must later fill in the missing arguments from the default.

This commit is contained in:
Christoph Oelckers 2018-11-16 18:41:27 +01:00
commit c24da62cdd
6 changed files with 16 additions and 11 deletions

View file

@ -5448,7 +5448,7 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
// The return value can be the same types as the parameter types, plus void
if (func->Proto->ReturnTypes.Size() == 0)
{
VMCall(func, &params[0], params.Size(), nullptr, 0);
VMCallWithDefaults(func, &params[0], params.Size(), nullptr, 0);
}
else
{
@ -5470,20 +5470,20 @@ static int ScriptCall(AActor *activator, unsigned argc, int32_t *args)
{
double d;
VMReturn ret(&d);
VMCall(func, &params[0], params.Size(), &ret, 1);
VMCallWithDefaults(func, &params[0], params.Size(), &ret, 1);
retval = DoubleToACS(d);
}
else if (rettype == TypeString)
{
FString d;
VMReturn ret(&d);
VMCall(func, &params[0], params.Size(), &ret, 1);
VMCallWithDefaults(func, &params[0], params.Size(), &ret, 1);
retval = GlobalACSStrings.AddString(d);
}
else
{
// All other return values can not be handled so ignore them.
VMCall(func, &params[0], params.Size(), nullptr, 0);
VMCallWithDefaults(func, &params[0], params.Size(), nullptr, 0);
}
}
}