design_utils: Fix memory error
Signed-off-by: gatecat <gatecat@ds0.me>
This commit is contained in:
parent
8a9fb81036
commit
3d0facf119
@ -161,7 +161,8 @@ void rename_net(Context *ctx, NetInfo *net, IdString new_name)
|
|||||||
if (net == nullptr)
|
if (net == nullptr)
|
||||||
return;
|
return;
|
||||||
NPNR_ASSERT(!ctx->nets.count(new_name));
|
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);
|
ctx->nets.erase(net->name);
|
||||||
net->name = new_name;
|
net->name = new_name;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user