+
+/* Subclass check for pointers to classes.
+ *
+ * Dereferences at both types the same amount of pointer types (as
+ * many as possible). If the remaining types are both class types
+ * and subclasses, returns true, else false. Can also be called with
+ * two class types. */
+int is_subclass_ptr_of(type *low, type *high) {
+ while (is_Pointer_type(low) && is_Pointer_type(high)) {
+ low = get_pointer_points_to_type(low);
+ high = get_pointer_points_to_type(high);
+ }
+
+ if (is_Class_type(low) && is_Class_type(high))
+ return is_subclass_of(low, high);
+ return 0;
+}
+