Fix gcc error, due to dict invalidation during recursion
authorEddie Hung <eddie@fpgeh.com>
Fri, 21 Jun 2019 04:55:08 +0000 (21:55 -0700)
committerEddie Hung <eddie@fpgeh.com>
Fri, 21 Jun 2019 04:55:08 +0000 (21:55 -0700)
Makefile
backends/aiger/xaiger.cc

index fd4e90c1526e8c2fba622c744226dd7bbe269759..f363be208414c0282cdb0040d7187e458b07735f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 
-CONFIG := clang
-CONFIG := gcc
+CONFIG := clang
+CONFIG := gcc
 # CONFIG := gcc-4.8
 # CONFIG := afl-gcc
 # CONFIG := emcc
index 82f0f24b2226fa1e5ab6457c6b68c2f308a7471c..32c3f904555c4a3ccab7654578b357ecf8554360 100644 (file)
@@ -101,12 +101,13 @@ struct XAigerWriter
                                aig_map[bit] = mkgate(a0, a1);
                        } else
                        if (alias_map.count(bit)) {
-                               aig_map[bit] = bit2aig(alias_map.at(bit));
+                               int a = bit2aig(alias_map.at(bit));
+                               aig_map[bit] = a;
                        }
 
                        if (bit == State::Sx || bit == State::Sz) {
                                log_debug("Bit '%s' contains 'x' or 'z' bits. Treating as 1'b0.\n", log_signal(bit));
-                               aig_map[bit] = 0;
+                               aig_map[bit] = aig_map.at(State::S0);
                        }
                }