Fix segfault in wreduce
authorClifford Wolf <clifford@clifford.at>
Tue, 30 Apr 2019 20:20:45 +0000 (22:20 +0200)
committerClifford Wolf <clifford@clifford.at>
Tue, 30 Apr 2019 20:20:45 +0000 (22:20 +0200)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
passes/opt/wreduce.cc

index 68e077cf9eb5e1249f9802494aa06e2fe4987c85..41de8aad10a58772337ca1d60bb3de4c7567ddac 100644 (file)
@@ -180,6 +180,8 @@ struct WreduceWorker
                        }
 
                        auto info = mi.query(sig_q[i]);
+                       if (info == nullptr)
+                               return;
                        if (!info->is_output && GetSize(info->ports) == 1 && !keep_bits.count(mi.sigmap(sig_q[i]))) {
                                remove_init_bits.insert(sig_q[i]);
                                sig_d.remove(i);