diff options
author | gatecat <gatecat@ds0.me> | 2021-07-06 11:34:14 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-07-06 11:35:27 +0100 |
commit | 3d0facf1192ca38e5326ff088c585dfc86b63dc2 (patch) | |
tree | 49bf2be0fc0664103140982c00202d93b19e623b /common/design_utils.cc | |
parent | 8a9fb810369aeb5eed128ef4e7d4de456ef1ec8f (diff) | |
download | nextpnr-3d0facf1192ca38e5326ff088c585dfc86b63dc2.tar.gz nextpnr-3d0facf1192ca38e5326ff088c585dfc86b63dc2.tar.bz2 nextpnr-3d0facf1192ca38e5326ff088c585dfc86b63dc2.zip |
design_utils: Fix memory error
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'common/design_utils.cc')
-rw-r--r-- | common/design_utils.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/design_utils.cc b/common/design_utils.cc index a892feaa..da5decf9 100644 --- a/common/design_utils.cc +++ b/common/design_utils.cc @@ -161,7 +161,8 @@ void rename_net(Context *ctx, NetInfo *net, IdString new_name) if (net == nullptr) return; NPNR_ASSERT(!ctx->nets.count(new_name)); - std::swap(ctx->nets[net->name], ctx->nets[new_name]); + ctx->nets[new_name]; + std::swap(ctx->nets.at(net->name), ctx->nets.at(new_name)); ctx->nets.erase(net->name); net->name = new_name; } |