Browse Source

u[0] was never getting initialized in insert_optimized

Ian Goldberg 1 year ago
parent
commit
7ed6c13978
1 changed files with 5 additions and 1 deletions
  1. 5 1
      heap.cpp

+ 5 - 1
heap.cpp

@@ -99,7 +99,11 @@ void MinHeap::insert_optimized(MPCTIO tio, yield_t & yield, RegAS val) {
 
     for (size_t j = 0; j < height; ++j) {
         if(tio.player() !=2) {
-            if(j > 0) u[j] = flag[j] ^ u[j-1];
+            if(j > 0) {
+                u[j] = flag[j] ^ u[j-1];
+            } else {
+                u[j] = flag[j];
+            }
         }
     }