diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2016-12-26 18:09:57 +0100 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2016-12-26 18:09:57 +0100 |
commit | 860f28734063628f5582be91c7429b14f0922917 (patch) | |
tree | 2e3a0306b26318bfb4ad2f06065440c991738381 /cparser/Elab.ml | |
parent | 9ae11643d2faaeedce3c69925ff5089437ea4dff (diff) | |
download | compcert-860f28734063628f5582be91c7429b14f0922917.tar.gz compcert-860f28734063628f5582be91c7429b14f0922917.zip |
Avoid exception catch-all
"try ...; true with _ -> false" is dangerous if "..." raises unexpected exceptions such as Out_of_memory or Stack_overflow.
Diffstat (limited to 'cparser/Elab.ml')
-rw-r--r-- | cparser/Elab.ml | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/Elab.ml b/cparser/Elab.ml index 7b2c14e9..845fc210 100644 --- a/cparser/Elab.ml +++ b/cparser/Elab.ml @@ -1184,7 +1184,7 @@ module I = struct let mem f id = try ignore(f env (id,name)); true - with _ -> false in + with Env.Error _ -> false in match ty with | TStruct (id,_) -> mem Env.find_struct_member id |