aboutsummaryrefslogtreecommitdiffhomepage
path: root/plugins/micromega/persistent_cache.ml
diff options
context:
space:
mode:
authorGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2016-05-20 16:21:42 +0200
committerGravatar Guillaume Melquiond <guillaume.melquiond@inria.fr>2016-05-20 16:21:42 +0200
commitbf1a1070d6cd111385baf59569feea2e0db3eb7c (patch)
tree9250f6079058d924cb879257bdfb6e6185facafb /plugins/micromega/persistent_cache.ml
parent088b3161c93e46ec2d865fe71a206cee15acd30c (diff)
Disable memoization rather than failing when files cannot be opened.
Anomaly: Uncaught exception Unix.Unix_error(Unix.EACCES, "open", "lia.cache"). Please report.
Diffstat (limited to 'plugins/micromega/persistent_cache.ml')
-rw-r--r--plugins/micromega/persistent_cache.ml8
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/micromega/persistent_cache.ml b/plugins/micromega/persistent_cache.ml
index 6a03e2d61..88b13abf9 100644
--- a/plugins/micromega/persistent_cache.ml
+++ b/plugins/micromega/persistent_cache.ml
@@ -212,9 +212,11 @@ let find t k =
res
let memo cache f =
- let tbl = lazy (open_in cache) in
- fun x ->
- let tbl = Lazy.force tbl in
+ let tbl = lazy (try Some (open_in cache) with _ -> None) in
+ fun x ->
+ match Lazy.force tbl with
+ | None -> f x
+ | Some tbl ->
try
find tbl x
with