Skip to content

Commit ab1bf8d

Browse files
ArcaneNibbleazonenberg
authored andcommittedSep 14, 2017
extract_reduce: Fix segfault on "undriven" inputs
This is easily triggered when un-techmapping if the technology-specific cell library isn't loaded. Outputs of technology-specific cells will be seen as inputs, and nets using those outputs will be seen as undriven. Just ignore these cells because they can't be part of a reduce chain anyways.
1 parent f9d023c commit ab1bf8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎passes/techmap/extract_reduce.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct ExtractReducePass : public Pass
160160
if (sig_to_sink[a[0]].size() + port_sigs.count(a[0]) == 1)
161161
{
162162
Cell* cell_a = sig_to_driver[a[0]];
163-
if (((cell_a->type == "$_AND_" && gt == GateType::And) ||
163+
if (cell_a && ((cell_a->type == "$_AND_" && gt == GateType::And) ||
164164
(cell_a->type == "$_OR_" && gt == GateType::Or) ||
165165
(cell_a->type == "$_XOR_" && gt == GateType::Xor)))
166166
{
@@ -177,7 +177,7 @@ struct ExtractReducePass : public Pass
177177
if (sig_to_sink[b[0]].size() + port_sigs.count(b[0]) == 1)
178178
{
179179
Cell* cell_b = sig_to_driver[b[0]];
180-
if (((cell_b->type == "$_AND_" && gt == GateType::And) ||
180+
if (cell_b && ((cell_b->type == "$_AND_" && gt == GateType::And) ||
181181
(cell_b->type == "$_OR_" && gt == GateType::Or) ||
182182
(cell_b->type == "$_XOR_" && gt == GateType::Xor)))
183183
{

0 commit comments

Comments
 (0)
Please sign in to comment.