https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=56270
for (auto subtype : subtypes) useful_types.insert(subtype);
                    }
                }
            }
            if (useful_types.size() == set_size) break;
        }
        
        for (auto type_it = table.begin(); type_it != table.end();) {
            if (useful_types.count(type_it->first) == 0) {
                type_it = table.erase(type_it);
            } else {
                ++type_it;
            }
        }
        /* Find which types are constructible. A type is constructible if there is a leaf
         * node recipe for constructing it, or a recipe whose subnodes are all constructible.
         * Types can be non-constructible because they have no recipes to begin with,
         * because they can only be constructed using recipes that involve otherwise
         * non-constructible types, or because they require infinite recursion. */
        std::set<Type> constructible_types{};
        auto known_constructible = [&](Type type) { return constructible_types.count(type) != 0; };
        
        while (true) {
            size_t set_size = constructible_types.size();
            
            for (const auto& [type, recipes] : table) {
                if (!known_constructible(type)) {
                    
                    for (const auto& [_, subt] : recipes) {