sim: Avoid a crash on empty cell connection.
authorMarcelina Kościelnicka <mwk@0x04.net>
Mon, 1 Mar 2021 19:01:39 +0000 (20:01 +0100)
committerMarcelina Kościelnicka <mwk@0x04.net>
Mon, 8 Mar 2021 16:03:31 +0000 (17:03 +0100)
Fixes #2513.

passes/sat/sim.cc

index 3ba66bd33cc080e55feb81ff4ed3ec08683c7e9a..922be886c0aae8a0dd4109fcbf43e31d44722365 100644 (file)
@@ -271,7 +271,7 @@ struct SimInstance
                {
                        auto child = children.at(cell);
                        for (auto &conn: cell->connections())
-                               if (cell->input(conn.first)) {
+                               if (cell->input(conn.first) && GetSize(conn.second)) {
                                        Const value = get_state(conn.second);
                                        child->set_state(child->module->wire(conn.first), value);
                                }