Its definition is:
vector<Context *> Grob_info::origin_contexts (Translator *end) const { Context *t = origin_trans_->context (); vector<Context *> r; do { r.push_back (t); t = t->get_parent_context (); } while (t && t != end->context ()); return r; } >From that there are several deductions: This array contains all contexts starting at the context where the grob originated (the one whose make_item got called) and ending _before_ the context of the named Translator. Unless both are identical in which case the entire context hierarchy gets returned. WTF? So the returned array will always include at least one context, namely the result of calling origin_trans_->context () which could equally well have been gotten calling context (). All uses I can discern either check whether the returned array is of non-zero size (which it always is) or then take the first element which could just be gotten by calling context () instead. WTF?!?!? Should we try changing the code such that it works as intended (presumably returning a 0-size vector when the contexts of the Grob_info and the given translator disagree which means fixing the unconditional accesses to [0]) or should we just say "to heck with it" and throw out all the stuff that apparently worked without ever needing origin_contexts? -- David Kastrup _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel