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)));