From 765776d136162c27a359127f626edcb17d8d84b9 Mon Sep 17 00:00:00 2001 From: Spooky309 Date: Sat, 16 May 2026 10:56:17 +0100 Subject: [PATCH] Honour no-thread-local for variables declared at procedure scope --- src/check_stmt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/check_stmt.cpp b/src/check_stmt.cpp index d6987a332..617002281 100644 --- a/src/check_stmt.cpp +++ b/src/check_stmt.cpp @@ -2260,7 +2260,9 @@ gb_internal void check_value_decl_stmt(CheckerContext *ctx, Ast *node, u32 mod_f error(e->token, "'thread_local' variables cannot be declared within a defer statement"); } } - e->Variable.thread_local_model = ac.thread_local_model; + if (!build_context.no_thread_local) { + e->Variable.thread_local_model = ac.thread_local_model; + } } if (ac.is_static && ac.thread_local_model != "") {