diff --git a/src/passes/Precompute.cpp b/src/passes/Precompute.cpp index 295d86b40e2..ba04a68aa26 100644 --- a/src/passes/Precompute.cpp +++ b/src/passes/Precompute.cpp @@ -858,7 +858,8 @@ struct Precompute } auto* child = stack[index]; - for (auto** currChild : ChildIterator(stack[index - 1]).children) { + auto childIterator = ChildIterator(stack[index - 1]); + for (auto** currChild : childIterator.children) { if (*currChild == child) { return currChild; }