From 1a34d6d33438671c8704388c3911a90bb2184a9b Mon Sep 17 00:00:00 2001 From: David Shah Date: Wed, 1 Aug 2018 14:39:56 +0200 Subject: ecp5: Memory fixes in packer Signed-off-by: David Shah --- ecp5/pack.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'ecp5') diff --git a/ecp5/pack.cc b/ecp5/pack.cc index 11cc2647..786f543e 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -325,19 +325,22 @@ class Ecp5Packer lut_to_slice(ctx, lut0, slice.get(), 0); lut_to_slice(ctx, lut1, slice.get(), 1); - auto ff0 = lutffPairs.find(lut0->name), ff1 = lutffPairs.find(lut1->name); + auto ff0 = lutffPairs.find(lut0->name); if (ff0 != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff0->second).get(), slice.get(), 0, true); packed_cells.insert(ff0->second); - lutffPairs.erase(lut0->name); fflutPairs.erase(ff0->second); + lutffPairs.erase(lut0->name); } + + auto ff1 = lutffPairs.find(lut1->name); + if (ff1 != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff1->second).get(), slice.get(), 1, true); packed_cells.insert(ff1->second); - lutffPairs.erase(lut1->name); fflutPairs.erase(ff1->second); + lutffPairs.erase(lut1->name); } new_cells.push_back(std::move(slice)); @@ -363,8 +366,8 @@ class Ecp5Packer if (ff != lutffPairs.end()) { ff_to_slice(ctx, ctx->cells.at(ff->second).get(), slice.get(), 0, true); packed_cells.insert(ff->second); - lutffPairs.erase(ci->name); fflutPairs.erase(ff->second); + lutffPairs.erase(ci->name); } new_cells.push_back(std::move(slice)); -- cgit v1.2.3