Skip to content

Commit

Permalink
Handle fallible allocation (abort if OOM)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtzguido committed Feb 5, 2025
1 parent b147a03 commit 7dc2f99
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/MerkleTree.EverCrypt.fst
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,11 @@ let mt_sha256_compress src1 src2 dst =
B.blit src2 0ul cb 32ul hash_size;

// ONLY WORKS BECAUSE hash_alg is inline_for_extraction and is known to be SHA2_256
let st = EHS.create_in hash_alg HyperStack.root in
let st =
match EHS.create_in hash_alg HyperStack.root with
| Some st -> st
| None -> LowStar.Failure.failwith "out of memory"
in
EHS.init #(Ghost.hide hash_alg) st;
let hh1 = HST.get () in
assert (S.equal (S.append
Expand Down

0 comments on commit 7dc2f99

Please sign in to comment.