projects
/
yosys.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45bfe26
)
Fixed memory corruption in subcircuit miner
author
Clifford Wolf
<clifford@clifford.at>
Sun, 3 Mar 2013 12:33:02 +0000
(13:33 +0100)
committer
Clifford Wolf
<clifford@clifford.at>
Sun, 3 Mar 2013 12:33:02 +0000
(13:33 +0100)
libs/subcircuit/subcircuit.cc
patch
|
blob
|
history
diff --git
a/libs/subcircuit/subcircuit.cc
b/libs/subcircuit/subcircuit.cc
index 2c6f3d827d8faf0b18976b048deef81c8a33edf7..0138d5a0f2015bf083eb4e5f7223e40fc72f08ad 100644
(file)
--- a/
libs/subcircuit/subcircuit.cc
+++ b/
libs/subcircuit/subcircuit.cc
@@
-68,8
+68,10
@@
SubCircuit::Graph::Graph(const Graph &other, const std::vector<std::string> &oth
for (auto &i1 : other2this)
for (auto &i2 : other.nodes[i1.first].ports)
for (auto &i3 : i2.bits)
- if (edges2this.count(i3.edgeIdx) == 0)
- edges2this[i3.edgeIdx] = edges2this.size();
+ if (edges2this.count(i3.edgeIdx) == 0) {
+ int next_idx = edges2this.size();
+ edges2this[i3.edgeIdx] = next_idx;
+ }
edges.resize(edges2this.size());
for (auto &it : edges2this) {