Skip to content

Fix correctness issues caused by reusing boilerplate code

Alexandre Macabies requested to merge Zopieux/gi-docgen:fix-copypaste into main

There are two instances where a variable from a previous for-loop body is reused in an unrelated for-loop. It works by accident, but stores or prints the wrong element. The one for unions is particularly concerning since it maps the same random record (from the previous loop) to all union identifiers, leading to an incorrect index.

There is another location where an assignment was forgotten. It is a "time bomb" since some codebase could trigger the code reading cls_method_desc when it's not previously defined (cls_method.doc is None branch), causing a runtime exception.

Merge request reports