From 40625b24e2f08a20cafefc10bf4d13db9a3a93cc Mon Sep 17 00:00:00 2001 From: Laytan Laats Date: Tue, 9 Jul 2024 19:49:12 +0200 Subject: [PATCH] fix optimization mode, cold, and disabled not being applied to poly procs --- src/check_expr.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/check_expr.cpp b/src/check_expr.cpp index 782f60fda..799650656 100644 --- a/src/check_expr.cpp +++ b/src/check_expr.cpp @@ -587,6 +587,16 @@ gb_internal bool find_or_generate_polymorphic_procedure(CheckerContext *old_c, E entity->file = base_entity->file; entity->pkg = base_entity->pkg; entity->flags = 0; + + entity->Procedure.optimization_mode = base_entity->Procedure.optimization_mode; + + if (base_entity->flags & EntityFlag_Cold) { + entity->flags |= EntityFlag_Cold; + } + if (base_entity->flags & EntityFlag_Disabled) { + entity->flags |= EntityFlag_Disabled; + } + d->entity = entity; AstFile *file = nullptr;