summaryrefslogtreecommitdiff
path: root/passes/techmap
diff options
context:
space:
mode:
authorMarcus Comstedt <marcus@mc.pp.se>2015-11-08 19:16:56 +0100
committerMarcus Comstedt <marcus@mc.pp.se>2015-11-08 19:16:56 +0100
commit8c2bdef36dbdb5b830757a4f74a7600b45828698 (patch)
tree24ff88378d93bba90017406845c6e91010cbb2de /passes/techmap
parent1ec6429bad4d793b389ee594b1cb2575bf73ddaf (diff)
Fix a segfault in dffinit when the value has too few bits
The code was already trying to add the required number of bits, but fell one short of the mark.
Diffstat (limited to 'passes/techmap')
-rw-r--r--passes/techmap/dffinit.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/passes/techmap/dffinit.cc b/passes/techmap/dffinit.cc
index 6a80f043..e0273f43 100644
--- a/passes/techmap/dffinit.cc
+++ b/passes/techmap/dffinit.cc
@@ -100,7 +100,7 @@ struct DffinitPass : public Pass {
for (int i = 0; i < GetSize(sig); i++) {
if (init_bits.count(sig[i]) == 0)
continue;
- while (GetSize(value.bits) < i)
+ while (GetSize(value.bits) <= i)
value.bits.push_back(State::S0);
value.bits[i] = init_bits.at(sig[i]);
cleanup_bits.insert(sig[i]);