- added a few checks for null pointer types in the ZScript compiler.

This commit is contained in:
Christoph Oelckers 2023-07-22 08:59:15 +02:00
parent ce34ef2921
commit 706c784965
2 changed files with 3 additions and 3 deletions

View file

@ -8858,7 +8858,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx)
}
}
if (Self->ValueType->isRealPointer())
if (Self->ValueType->isRealPointer() && Self->ValueType->toPointer()->PointedType)
{
auto ptype = Self->ValueType->toPointer()->PointedType;
cls = ptype->toContainer();

View file

@ -348,8 +348,8 @@ public:
bool IsQuaternion() const { return ValueType == TypeQuaternion || ValueType == TypeFQuaternion || ValueType == TypeQuaternionStruct; };
bool IsBoolCompat() const { return ValueType->isScalar(); }
bool IsObject() const { return ValueType->isObjectPointer(); }
bool IsArray() const { return ValueType->isArray() || (ValueType->isPointer() && ValueType->toPointer()->PointedType->isArray()); }
bool isStaticArray() const { return (ValueType->isPointer() && ValueType->toPointer()->PointedType->isStaticArray()); } // can only exist in pointer form.
bool IsArray() const { return ValueType->isArray() || (ValueType->isPointer() && ValueType->toPointer()->PointedType && ValueType->toPointer()->PointedType->isArray()); }
bool isStaticArray() const { return (ValueType->isPointer() && ValueType->toPointer()->PointedType && ValueType->toPointer()->PointedType->isStaticArray()); } // can only exist in pointer form.
bool IsDynamicArray() const { return (ValueType->isDynArray()); }
bool IsMap() const { return ValueType->isMap(); }
bool IsMapIterator() const { return ValueType->isMapIterator(); }