appleseedlab/maki

`isInTree()` has a premature return

Closed this issue · 0 comments

While doing some code maintenance on Maki and moving the AST helper functions in MakiASTConsumer.cc into ASTUtils, I found a premature return bug in the definition of isInTree():

    for (auto &&child : Stmt->children()) {
        return isInTree(child, pred));
    }

Instead of checking if the predicate pred holds for any of a node's children, this for loop will return if the predicate holds for the first child, if there is one.

Maki's test suite does not currently notice this issue.