Skip to content

Commit b8871f3

Browse files
author
vincelasal
committed
Cleared a null pointer that was causing seg fault.
1 parent 99cb227 commit b8871f3

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

ODIN_II/SRC/output_blif.c

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -623,22 +623,25 @@ void define_set_input_logical_function(nnode_t *node, const char *bit_output, FI
623623
/* printout all the port hookups */
624624
for (i = 0; i < node->num_input_pins; i++)
625625
{
626-
if (node->input_pins[i]->net->driver_pin->name != NULL)
626+
if (node->input_pins[i]->net->driver_pin != NULL)
627627
{
628-
/* now hookup the input wires with their respective ports. [1+i] to skip output spot. */
629-
/* Just print the driver_pin->name NOT driver_pin->node->name -- KEN */
630-
if ((node->input_pins[i]->net->driver_pin->node->type == MULTIPLY) ||
631-
(node->input_pins[i]->net->driver_pin->node->type == HARD_IP) ||
632-
(node->input_pins[i]->net->driver_pin->node->type == MEMORY) ||
633-
(node->input_pins[i]->net->driver_pin->node->type == ADD) ||
634-
(node->input_pins[i]->net->driver_pin->node->type == MINUS))
628+
if (node->input_pins[i]->net->driver_pin->name != NULL)
635629
{
636-
fprintf(out, " %s", node->input_pins[i]->net->driver_pin->name);
630+
/* now hookup the input wires with their respective ports. [1+i] to skip output spot. */
631+
/* Just print the driver_pin->name NOT driver_pin->node->name -- KEN */
632+
if ((node->input_pins[i]->net->driver_pin->node->type == MULTIPLY) ||
633+
(node->input_pins[i]->net->driver_pin->node->type == HARD_IP) ||
634+
(node->input_pins[i]->net->driver_pin->node->type == MEMORY) ||
635+
(node->input_pins[i]->net->driver_pin->node->type == ADD) ||
636+
(node->input_pins[i]->net->driver_pin->node->type == MINUS))
637+
{
638+
fprintf(out, " %s", node->input_pins[i]->net->driver_pin->name);
639+
}
640+
}
641+
else
642+
{
643+
fprintf(out, " %s", node->input_pins[i]->net->driver_pin->node->name);
637644
}
638-
}
639-
else
640-
{
641-
fprintf(out, " %s", node->input_pins[i]->net->driver_pin->node->name);
642645
}
643646
}
644647

0 commit comments

Comments
 (0)