aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgatecat <gatecat@ds0.me>2023-04-11 11:16:40 +0200
committermyrtle <gatecat@ds0.me>2023-04-12 06:56:59 +0200
commit7557d33dc670f0863c5a085e1d755ff693e05fbf (patch)
tree8cd1ce9e6a79fe97640906823b583510dd0b1b33
parent6455b5dd2661fd76bccc32a42577fecd4e43752d (diff)
downloadnextpnr-7557d33dc670f0863c5a085e1d755ff693e05fbf.tar.gz
nextpnr-7557d33dc670f0863c5a085e1d755ff693e05fbf.tar.bz2
nextpnr-7557d33dc670f0863c5a085e1d755ff693e05fbf.zip
ecp5: Fix invalid accesses during certain IO packing cases
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r--ecp5/pack.cc2
1 files changed, 2 insertions, 0 deletions
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 {