From 872a197e94c477727845c1f0518a554fbaaacbd5 Mon Sep 17 00:00:00 2001 From: "Emil J. Tywoniak" Date: Mon, 14 Apr 2025 12:41:14 +0200 Subject: [PATCH] memory_libmap: fix MapWorker memory allocation --- passes/memory/memory_libmap.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/passes/memory/memory_libmap.cc b/passes/memory/memory_libmap.cc index b0d0498ea..a5b30c7ae 100644 --- a/passes/memory/memory_libmap.cc +++ b/passes/memory/memory_libmap.cc @@ -2232,11 +2232,11 @@ struct MemoryLibMapPass : public Pass { if (module->has_processes_warn()) continue; - MapWorker worker(module); + auto worker = std::make_unique(module); auto mems = Mem::get_selected_memories(module); for (auto &mem : mems) { - MemMapping map(worker, mem, lib, opts); + MemMapping map(*worker, mem, lib, opts); int idx = -1; int best = map.logic_cost; if (!map.logic_ok) { @@ -2259,7 +2259,7 @@ struct MemoryLibMapPass : public Pass { } else { map.emit(map.cfgs[idx]); // Rebuild indices after modifying module - worker = MapWorker(module); + worker = std::make_unique(module); } } }