From 7557d33dc670f0863c5a085e1d755ff693e05fbf Mon Sep 17 00:00:00 2001 From: gatecat Date: Tue, 11 Apr 2023 11:16:40 +0200 Subject: ecp5: Fix invalid accesses during certain IO packing cases Signed-off-by: gatecat --- ecp5/pack.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ecp5/pack.cc b/ecp5/pack.cc index d605b4a3..3b56daa9 100644 --- a/ecp5/pack.cc +++ b/ecp5/pack.cc @@ -552,11 +552,13 @@ class Ecp5Packer if (ionet != nullptr) { ctx->nets.erase(ionet->name); tp.cell->ports.at(tp.port).net = nullptr; + ci->ports.at(ci->type == ctx->id("$nextpnr_obuf") ? id_I : id_O).net = nullptr; } if (ci->type == ctx->id("$nextpnr_iobuf")) { NetInfo *net2 = ci->ports.at(id_I).net; if (net2 != nullptr) { ctx->nets.erase(net2->name); + ci->ports.at(id_I).net = nullptr; } } } else { -- cgit v1.2.3