diff options
author | Son HO | 2024-04-07 15:09:58 +0200 |
---|---|---|
committer | GitHub | 2024-04-07 15:09:58 +0200 |
commit | 05164f1ea87b7da14f60e6dbcc718a4f8d639ea1 (patch) | |
tree | 7973a53f134c38a856376b6204a7c76900eaafe7 /compiler/Interpreter.ml | |
parent | d8650bfc5c4dc78fda13953dac93c9e6c24489d1 (diff) | |
parent | a9a2f81e365eeef4fd157fb56cd5107f95c91163 (diff) |
Merge pull request #113 from AeneasVerif/escherichia/error_catching_translate
Error catching should tell when code couldn't be generated
Diffstat (limited to '')
-rw-r--r-- | compiler/Interpreter.ml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/compiler/Interpreter.ml b/compiler/Interpreter.ml index d0a54750..769e3144 100644 --- a/compiler/Interpreter.ml +++ b/compiler/Interpreter.ml @@ -191,6 +191,18 @@ let initialize_symbolic_context_for_fun (ctx : decls_ctx) (fdef : fun_decl) : * do it, and because it gives a bit of sanity. * *) let sg = fdef.signature in + (* Sanity check: no nested borrows, borrows in ADTs, etc. *) + cassert __FILE__ __LINE__ + (List.for_all + (fun ty -> not (ty_has_nested_borrows ctx.type_ctx.type_infos ty)) + (sg.output :: sg.inputs)) + fdef.meta "Nested borrows are not supported yet"; + cassert __FILE__ __LINE__ + (List.for_all + (fun ty -> not (ty_has_adt_with_borrows ctx.type_ctx.type_infos ty)) + (sg.output :: sg.inputs)) + fdef.meta "ADTs containing borrows are not supported yet"; + (* Create the context *) let regions_hierarchy = FunIdMap.find (FRegular fdef.def_id) ctx.fun_ctx.regions_hierarchies |