diff --git a/src/script_opt/Expr.cc b/src/script_opt/Expr.cc index c9679838a4..3b26e9b99a 100644 --- a/src/script_opt/Expr.cc +++ b/src/script_opt/Expr.cc @@ -2363,6 +2363,10 @@ ExprPtr CallExpr::Duplicate() ExprPtr CallExpr::Inline(Inliner* inl) { + // First check our elements. + func = func->Inline(inl); + args = cast_intrusive(args->Inline(inl)); + auto new_me = inl->CheckForInlining({NewRef{}, this}); if ( ! new_me ) @@ -2372,10 +2376,6 @@ ExprPtr CallExpr::Inline(Inliner* inl) if ( new_me.get() != this ) return new_me; - // We're not inlining, but perhaps our elements should be. - func = func->Inline(inl); - args = cast_intrusive(args->Inline(inl)); - return ThisPtr(); }