mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
Fix deserialization of methods inside function pointers
This commit is contained in:
parent
e61bd10bbf
commit
d9a88d7080
1 changed files with 22 additions and 21 deletions
|
@ -2973,7 +2973,7 @@ bool PFunctionPointer::ReadValue(FSerializer &ar, const char *key, void *addr) c
|
|||
if(!p)
|
||||
{
|
||||
*fn = nullptr;
|
||||
Printf(TEXTCOLOR_RED "Function Pointer (%s::%s): symbol '%s' in class '%s' is a variable, not a function\n",
|
||||
Printf(TEXTCOLOR_RED "Function Pointer (%s::%s): '%s' in class '%s' is a variable, not a function\n",
|
||||
val.ClassName.GetChars(),
|
||||
val.FunctionName.GetChars(),
|
||||
val.FunctionName.GetChars(),
|
||||
|
@ -2982,7 +2982,10 @@ bool PFunctionPointer::ReadValue(FSerializer &ar, const char *key, void *addr) c
|
|||
ar.mErrors++;
|
||||
return false;
|
||||
}
|
||||
else if(p->GetImplicitArgs() > 0)
|
||||
*fn = NativeFunctionPointerCast(p, this);
|
||||
if(!*fn)
|
||||
{
|
||||
if((p->Variants[0].Flags & (VARF_Action | VARF_Virtual)) != 0)
|
||||
{
|
||||
*fn = nullptr;
|
||||
Printf(TEXTCOLOR_RED "Function Pointer (%s::%s): function '%s' in class '%s' is %s, not a static function\n",
|
||||
|
@ -2990,13 +2993,10 @@ bool PFunctionPointer::ReadValue(FSerializer &ar, const char *key, void *addr) c
|
|||
val.FunctionName.GetChars(),
|
||||
val.FunctionName.GetChars(),
|
||||
val.ClassName.GetChars(),
|
||||
(p->GetImplicitArgs() == 1 ? "a method" : "an action function")
|
||||
(p->GetImplicitArgs() == 1 ? "a virtual function" : "an action function")
|
||||
);
|
||||
ar.mErrors++;
|
||||
return false;
|
||||
}
|
||||
*fn = NativeFunctionPointerCast(p, this);
|
||||
if(!*fn)
|
||||
else
|
||||
{
|
||||
FString fn_name = MakeFunctionPointerDescriptiveName(p->Variants[0].Proto,p->Variants[0].ArgFlags, FScopeBarrier::SideFromFlags(p->Variants[0].Flags));
|
||||
Printf(TEXTCOLOR_RED "Function Pointer (%s::%s) has incompatible type (Pointer is '%s', Function is '%s')\n",
|
||||
|
@ -3005,6 +3005,7 @@ bool PFunctionPointer::ReadValue(FSerializer &ar, const char *key, void *addr) c
|
|||
fn_name.GetChars(),
|
||||
mDescriptiveName.GetChars()
|
||||
);
|
||||
}
|
||||
ar.mErrors++;
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue