Do not access beyond bounds
authorEddie Hung <eddie@fpgeh.com>
Fri, 19 Jul 2019 20:58:50 +0000 (13:58 -0700)
committerEddie Hung <eddie@fpgeh.com>
Fri, 19 Jul 2019 20:58:50 +0000 (13:58 -0700)
passes/opt/wreduce.cc

index 294f0d57e15c35de14e204b87b442e32704ba315..908a85d5b5304243ea8e371579c137fe32a8057f 100644 (file)
@@ -372,7 +372,7 @@ struct WreduceWorker
 
                        int i;
                        for (i = 0; i < GetSize(sig); i++) {
-                               if (B[i] != S0 && (sub || A[i] != S0))
+                               if (B.at(i, Sx) != S0 && (sub || A.at(i, Sx) != S0))
                                        break;
                                if (B[i] == S0)
                                        module->connect(sig[i], A[i]);