From abc4481431367c0dae46b52002573f0f64f4e273 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 12 Apr 2017 13:11:59 +0200 Subject: [PATCH] - set PointedType to null for PClassPointer to simplify the functions for this class. --- src/dobjtype.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index 96314d025..1cf8af53b 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -1625,10 +1625,7 @@ void PClassPointer::SetPointer(void *base, unsigned offset, TArray *spec bool PClassPointer::IsMatch(intptr_t id1, intptr_t id2) const { - const PType *pointat = (const PType *)id1; const PClass *classat = (const PClass *)id2; - - assert(pointat->IsKindOf(RUNTIME_CLASS(PClass))); return classat == ClassRestriction; } @@ -1640,8 +1637,7 @@ bool PClassPointer::IsMatch(intptr_t id1, intptr_t id2) const void PClassPointer::GetTypeIDs(intptr_t &id1, intptr_t &id2) const { - assert(PointedType == RUNTIME_CLASS(PClass)); - id1 = (intptr_t)PointedType; + id1 = 0; id2 = (intptr_t)ClassRestriction; } @@ -1656,11 +1652,11 @@ void PClassPointer::GetTypeIDs(intptr_t &id1, intptr_t &id2) const PClassPointer *NewClassPointer(PClass *restrict) { size_t bucket; - PType *ptype = TypeTable.FindType(RUNTIME_CLASS(PClassPointer), (intptr_t)RUNTIME_CLASS(PClass), (intptr_t)restrict, &bucket); + PType *ptype = TypeTable.FindType(RUNTIME_CLASS(PClassPointer), 0, (intptr_t)restrict, &bucket); if (ptype == nullptr) { ptype = new PClassPointer(restrict); - TypeTable.AddType(ptype, RUNTIME_CLASS(PClassPointer), (intptr_t)RUNTIME_CLASS(PClass), (intptr_t)restrict, bucket); + TypeTable.AddType(ptype, RUNTIME_CLASS(PClassPointer), 0, (intptr_t)restrict, bucket); } return static_cast(ptype); }