From 9a4652e0f8309173459e65323e69c90dc2d12c9d Mon Sep 17 00:00:00 2001 From: Jasper Homann Date: Fri, 7 Aug 2026 12:28:24 +0200 Subject: [PATCH] Protect json import with mutex Signed-off-by: Jasper Homann --- frontend/frontend_base.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/frontend_base.h b/frontend/frontend_base.h index 381b62c2..5f0e6481 100644 --- a/frontend/frontend_base.h +++ b/frontend/frontend_base.h @@ -132,6 +132,9 @@ template struct GenericFrontend m.is_toplevel = true; m.prefix = ""; m.path = top; + + std::lock_guard lock(ctx->mutex); + ctx->top_module = top; // Do the actual import, starting from the top level module import_module(m, top.str(ctx), top.str(ctx), mod_refs.at(top.str(ctx)));