mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- fixed: Reference types passed as a reference parameter were not properly checked for.
This commit is contained in:
parent
5e3e4a3bd1
commit
2d1641f0cd
1 changed files with 6 additions and 3 deletions
|
@ -8816,12 +8816,15 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
|||
ArgList[i] = ArgList[i]->Resolve(ctx); // nust be resolved before the address is requested.
|
||||
if (ArgList[i] != nullptr && ArgList[i]->ValueType != TypeNullPtr)
|
||||
{
|
||||
ArgList[i]->RequestAddress(ctx, &writable);
|
||||
if (flag & VARF_Ref) ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
|
||||
if (type != ArgList[i]->ValueType)
|
||||
{
|
||||
ArgList[i]->RequestAddress(ctx, &writable);
|
||||
if (flag & VARF_Ref)ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
|
||||
}
|
||||
// For a reference argument the types must match 100%.
|
||||
if (type != ArgList[i]->ValueType)
|
||||
{
|
||||
ScriptPosition.Message(MSG_ERROR, "Type mismatch in reference argument %s", Function->SymbolName.GetChars());
|
||||
ScriptPosition.Message(MSG_ERROR, "Type mismatch in reference argument %s: %s != %s", Function->SymbolName.GetChars(), type->DescriptiveName(), ArgList[i]->ValueType->DescriptiveName());
|
||||
x = nullptr;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue