소스 검색

binary_search sometimes returned -1 instead of 1 when searching over a single item

Ian Goldberg 6 달 전
부모
커밋
650561d158
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 3 1
      duoram.cpp

+ 3 - 1
duoram.cpp

@@ -104,7 +104,9 @@ RegXS Duoram<RegAS>::Shape::binary_search(RegAS &target)
         // answer is here or to the left, so it must be 0.  If val <
         // target, the answer is strictly to the right, so it must be 1.
         // So just return lt.
-        return RegXS(lt);
+        RegXS ret;
+        ret.xshare = lt.bshare;
+        return ret;
     }
     auto oidx = P.oblivindex(depth-1);
     oidx.incr(lt);