mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 21:11:39 +00:00
- always pass complete argument lists in the VM.
This commit is contained in:
parent
16053c7cdb
commit
95ab1da6a0
2 changed files with 32 additions and 0 deletions
|
@ -9127,6 +9127,31 @@ ExpEmit FxVMFunctionCall::Emit(VMFunctionBuilder *build)
|
|||
{
|
||||
count += EmitParameter(build, ArgList[i], ScriptPosition, &tempstrings);
|
||||
}
|
||||
// Complete the parameter list from the defaults.
|
||||
auto &defaults = Function->Variants[0].Implementation->DefaultArgs;
|
||||
for (unsigned i = count; i < defaults.Size(); i++)
|
||||
{
|
||||
FxConstant *constant;
|
||||
switch (defaults[i].Type)
|
||||
{
|
||||
default:
|
||||
case REGT_INT:
|
||||
constant = new FxConstant(defaults[i].i, ScriptPosition);
|
||||
break;
|
||||
case REGT_FLOAT:
|
||||
constant = new FxConstant(defaults[i].f, ScriptPosition);
|
||||
break;
|
||||
case REGT_POINTER:
|
||||
constant = new FxConstant(defaults[i].a, ScriptPosition);
|
||||
break;
|
||||
case REGT_STRING:
|
||||
constant = new FxConstant(defaults[i].s(), ScriptPosition);
|
||||
break;
|
||||
}
|
||||
count += EmitParameter(build, constant, ScriptPosition, &tempstrings);
|
||||
delete constant;
|
||||
}
|
||||
|
||||
ArgList.DeleteAndClear();
|
||||
ArgList.ShrinkToFit();
|
||||
|
||||
|
|
|
@ -501,6 +501,13 @@ public:
|
|||
isresolved = true;
|
||||
}
|
||||
|
||||
FxConstant(void *state, const FScriptPosition &pos) : FxExpression(EFX_Constant, pos)
|
||||
{
|
||||
value.pointer = state;
|
||||
ValueType = value.Type = TypeVoidPtr;
|
||||
isresolved = true;
|
||||
}
|
||||
|
||||
FxConstant(const FScriptPosition &pos) : FxExpression(EFX_Constant, pos)
|
||||
{
|
||||
value.pointer = nullptr;
|
||||
|
|
Loading…
Reference in a new issue