diff options
| author | Lasse Blaauwbroek | 2021-04-19 11:08:03 +0200 |
|---|---|---|
| committer | Lasse Blaauwbroek | 2021-04-19 12:46:13 +0200 |
| commit | e50a6195097c0d15c839c5403c1d02511afd54e4 (patch) | |
| tree | c612ea3c2817cb23cb6ff34d3e71b2e1b50ab05a /plugins/extraction/mlutil.ml | |
| parent | 00391bd681098132cc89c356d1d27334d257fc8b (diff) | |
Check for existence before using `Global.lookup_constant` instead of catching `Not_found`
`Global.lookup_constant` fails with an assertion instead of `Not_found`. Some
code relied upon `Not_found`.
Diffstat (limited to 'plugins/extraction/mlutil.ml')
| -rw-r--r-- | plugins/extraction/mlutil.ml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/extraction/mlutil.ml b/plugins/extraction/mlutil.ml index cfdaac710b..268d4bf9e9 100644 --- a/plugins/extraction/mlutil.ml +++ b/plugins/extraction/mlutil.ml @@ -1525,8 +1525,7 @@ let inline_test r t = else let c = match r with GlobRef.ConstRef c -> c | _ -> assert false in let has_body = - try constant_has_body (Global.lookup_constant c) - with Not_found -> false + Environ.mem_constant c (Global.env()) && constant_has_body (Global.lookup_constant c) in has_body && (let t1 = eta_red t in |
