Branch: Tag:

2021-02-05

2021-02-05 10:56:14 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Compiler [Typechecker]: Fix handling of NULL in debug_free_type().

debug_free_type() attempted to dereference NULL when it looped
on certain types.

324:      void debug_free_type(struct pike_type *t)   { +  loop:    if (!t) return;   #ifdef DEBUG_MALLOC    if (t == (struct pike_type *)(size_t)0x55555555) {    Pike_fatal("Freeing dead type.\n");    }   #endif /* DEBUG_MALLOC */ -  loop: +     if (!sub_ref(t)) {    unsigned INT32 hash = t->hash & pike_type_hash_size;    struct pike_type **t2 = pike_type_hash + hash;