diff --git a/src/Func.cc b/src/Func.cc index e6047df71e..294a6890fd 100644 --- a/src/Func.cc +++ b/src/Func.cc @@ -574,7 +574,7 @@ void ScriptFunc::ReplaceBody(const StmtPtr& old_body, StmtPtr new_body) { if ( new_body ) body->stmts = new_body; else - bodies.erase(body); + body = bodies.erase(body); found_it = true; current_body = *body; diff --git a/src/Func.h b/src/Func.h index 409e1f1e64..edfe258680 100644 --- a/src/Func.h +++ b/src/Func.h @@ -265,7 +265,7 @@ public: */ void ReplaceBody(const detail::StmtPtr& old_body, detail::StmtPtr new_body); - auto CurrentBody() const { return current_body; } + const Body& CurrentBody() const { return current_body; } /** * Returns the function's frame size. diff --git a/src/script_opt/CPP/DeclFunc.cc b/src/script_opt/CPP/DeclFunc.cc index 079fa0f4f8..29068321a0 100644 --- a/src/script_opt/CPP/DeclFunc.cc +++ b/src/script_opt/CPP/DeclFunc.cc @@ -127,7 +127,7 @@ void CPPCompile::CreateFunction(const FuncTypePtr& ft, const ProfileFunc* pf, co body_info[fname] = {.hash = pf->HashVal(), .priority = priority, .loc = body->GetLocationInfo(), - .module = module_group, + .module = std::move(module_group), .groups = std::move(attr_groups)}; body_names.emplace(body.get(), fname); } diff --git a/src/script_opt/ProfileFunc.cc b/src/script_opt/ProfileFunc.cc index 02f674793e..7e753f6621 100644 --- a/src/script_opt/ProfileFunc.cc +++ b/src/script_opt/ProfileFunc.cc @@ -880,7 +880,7 @@ void ProfileFuncs::AnalyzeLambdaProfile(const LambdaExpr* l) { lambda_primaries[l->Name()] = l->PrimaryFunc().get(); if ( compute_func_hashes || ! pf->HasHashVal() ) - ComputeProfileHash(pf); + ComputeProfileHash(std::move(pf)); } void ProfileFuncs::ComputeProfileHash(std::shared_ptr pf) {