To find the most appropriate library for the given command line flags we iterate over a set of disk paths. Before probe each path the already detected set of multilibs are cleared. If the set of paths contains existing paths which do not satisfy command line flags or do not contain necessary libraries and object files at all we might lose found multilibs.
The patch updates variables which hold detected multilibs if we really find a new multilib matches command line flags.
Don't we need a
Result.Multilibs.clear();
here, that way Multilibs from different candidate sets don't get used together?
Or maybe I don't fully understand the problem that this (or the other patch) solves...