mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 20:43:15 +00:00
- fixed: For varargs, not only the type but also the flag of the last specified argument need to be stored for later parameters.
This commit is contained in:
parent
3c726aa570
commit
ab6b2f369e
1 changed files with 7 additions and 2 deletions
|
@ -7218,6 +7218,7 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
{
|
||||
bool foundvarargs = false;
|
||||
PType * type = nullptr;
|
||||
int flag = 0;
|
||||
if (argtypes.Last() != nullptr && ArgList.Size() + implicit > argtypes.Size())
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "Too many arguments in call to %s", Function->SymbolName.GetChars());
|
||||
|
@ -7231,12 +7232,16 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
if (!foundvarargs)
|
||||
{
|
||||
if (argtypes[i + implicit] == nullptr) foundvarargs = true;
|
||||
else type = argtypes[i + implicit];
|
||||
else
|
||||
{
|
||||
type = argtypes[i + implicit];
|
||||
flag = argflags[i + implicit];
|
||||
}
|
||||
}
|
||||
assert(type != nullptr);
|
||||
|
||||
FxExpression *x;
|
||||
if (!(argflags[i + implicit] & VARF_Ref))
|
||||
if (!(flag & VARF_Ref))
|
||||
{
|
||||
x = new FxTypeCast(ArgList[i], type, false);
|
||||
x = x->Resolve(ctx);
|
||||
|
|
Loading…
Reference in a new issue