mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-27 22:42:57 +00:00
- fixed: FxClassTypeCast must use FindClassTentative to get the class type.
This function may well be invoked before a class is actually defined, so it needs to create a placeholder to be filled in later.
This commit is contained in:
parent
1ca2293983
commit
8823b60c0d
2 changed files with 5 additions and 5 deletions
|
@ -913,12 +913,12 @@ public:
|
|||
|
||||
class FxClassTypeCast : public FxExpression
|
||||
{
|
||||
const PClass *desttype;
|
||||
PClass *desttype;
|
||||
FxExpression *basex;
|
||||
|
||||
public:
|
||||
|
||||
FxClassTypeCast(const PClass *dtype, FxExpression *x);
|
||||
FxClassTypeCast(PClass *dtype, FxExpression *x);
|
||||
~FxClassTypeCast();
|
||||
FxExpression *Resolve(FCompileContext&);
|
||||
ExpEmit Emit(VMFunctionBuilder *build);
|
||||
|
|
|
@ -3503,7 +3503,7 @@ ExpEmit FxReturnStatement::Emit(VMFunctionBuilder *build, bool tailcall)
|
|||
//
|
||||
//==========================================================================
|
||||
|
||||
FxClassTypeCast::FxClassTypeCast(const PClass *dtype, FxExpression *x)
|
||||
FxClassTypeCast::FxClassTypeCast(PClass *dtype, FxExpression *x)
|
||||
: FxExpression(x->ScriptPosition)
|
||||
{
|
||||
desttype = dtype;
|
||||
|
@ -3542,11 +3542,11 @@ FxExpression *FxClassTypeCast::Resolve(FCompileContext &ctx)
|
|||
if (basex->isConstant())
|
||||
{
|
||||
FName clsname = static_cast<FxConstant *>(basex)->GetValue().GetName();
|
||||
const PClass *cls = NULL;
|
||||
PClass *cls = NULL;
|
||||
|
||||
if (clsname != NAME_None)
|
||||
{
|
||||
cls = PClass::FindClass(clsname);
|
||||
cls = desttype->FindClassTentative(clsname);
|
||||
if (cls == NULL)
|
||||
{
|
||||
/* lax */
|
||||
|
|
Loading…
Reference in a new issue