summaryrefslogtreecommitdiffstats
path: root/Object.c
diff options
context:
space:
mode:
authorBenny Baumann <BenBE@geshi.org>2020-11-01 01:09:51 +0100
committerBenny Baumann <BenBE@geshi.org>2020-11-02 22:15:01 +0100
commit45869513bfebba80cc2ab42e4218f68b34b1e6ac (patch)
treef064631dbff141bf1c945db8cff40b7bb82fd169 /Object.c
parent61e14d4bb25268593019e6df3eb02264b4ac8e0e (diff)
Embracing branches
Diffstat (limited to 'Object.c')
-rw-r--r--Object.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/Object.c b/Object.c
index 01b6c4ce..975c8d48 100644
--- a/Object.c
+++ b/Object.c
@@ -20,12 +20,16 @@ const ObjectClass Object_class = {
bool Object_isA(const Object* o, const ObjectClass* klass) {
if (!o)
return false;
+
const ObjectClass* type = o->klass;
while (type) {
- if (type == klass)
+ if (type == klass) {
return true;
+ }
+
type = type->extends;
}
+
return false;
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy