diff --git a/src/Analyzer/Passes/AnyFunctionPass.cpp b/src/Analyzer/Passes/AnyFunctionPass.cpp index 6aba5a6cfae..63221a4d197 100644 --- a/src/Analyzer/Passes/AnyFunctionPass.cpp +++ b/src/Analyzer/Passes/AnyFunctionPass.cpp @@ -59,12 +59,6 @@ public: if (!getSettings().optimize_move_functions_out_of_any) return; - if (rewritten.contains(node.get())) - { - node = rewritten.at(node.get()); - return; - } - auto * function_node = node->as(); if (!function_node) return; @@ -94,6 +88,12 @@ public: if (inside_arguments.empty()) return; + if (rewritten.contains(node.get())) + { + node = rewritten.at(node.get()); + return; + } + /// checking done, rewrite function bool pushed = false; for (auto & inside_argument : inside_arguments)