Commit 8b67dbad authored by Andrei Paskevich's avatar Andrei Paskevich

Dexpr: relax alias restrictions on non-recursive functions

There is no reason why an abstract block cannot return an alias
with some external variable or exception.
parent 65844aa6
......@@ -962,8 +962,8 @@ let check_aliases recu c =
external local exception %a" print_xs (Sxs.choose sxs)
else Loc.errorm "The type of this function contains an alias" in
(* we allow the value in a non-recursive function to contain
regions coming the function's arguments, but not from the
context. It is sometimes useful to write a function around
regions coming the function's arguments or from the context.
It is safe and sometimes useful to write a function around
a constructor or a projection. For recursive functions, we
impose the full non-alias discipline, to ensure the safety
of region polymorphism (see add_rec_mono). We do not track
......@@ -975,7 +975,7 @@ let check_aliases recu c =
Mreg.union report regs frz.isb_reg in
let add_arg regs v = add_ity regs v.pv_ity in
let regs = List.fold_left add_arg rds_regs c.cty_args in
ignore (add_ity (if recu then regs else rds_regs) c.cty_result)
if recu then ignore (add_ity regs c.cty_result)
let check_fun inr rsym dsp e =
let c,e = match e with
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment