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
|
@ -8815,13 +8815,16 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
||||||
bool writable;
|
bool writable;
|
||||||
ArgList[i] = ArgList[i]->Resolve(ctx); // nust be resolved before the address is requested.
|
ArgList[i] = ArgList[i]->Resolve(ctx); // nust be resolved before the address is requested.
|
||||||
if (ArgList[i] != nullptr && ArgList[i]->ValueType != TypeNullPtr)
|
if (ArgList[i] != nullptr && ArgList[i]->ValueType != TypeNullPtr)
|
||||||
|
{
|
||||||
|
if (type != ArgList[i]->ValueType)
|
||||||
{
|
{
|
||||||
ArgList[i]->RequestAddress(ctx, &writable);
|
ArgList[i]->RequestAddress(ctx, &writable);
|
||||||
if (flag & VARF_Ref) ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
|
if (flag & VARF_Ref)ArgList[i]->ValueType = NewPointer(ArgList[i]->ValueType);
|
||||||
|
}
|
||||||
// For a reference argument the types must match 100%.
|
// For a reference argument the types must match 100%.
|
||||||
if (type != ArgList[i]->ValueType)
|
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;
|
x = nullptr;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue