diff options
author | Mark Shinwell <mshinwell@gmail.com> | 2017-03-07 14:14:42 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-07 14:14:42 +0000 |
commit | 8801274af34f0c9889269524521e878a5d63d3b9 (patch) | |
tree | cfbc81ee5a9b8f57531119b15d97c7a8bf6cc3c3 /asmcomp/liveness.ml | |
parent | 93c32dbd10d8b6f698aaabef46192a6d5370d268 (diff) | |
download | ocaml-8801274af34f0c9889269524521e878a5d63d3b9.tar.gz |
Allocation may raise exceptions (#852)
Diffstat (limited to 'asmcomp/liveness.ml')
-rw-r--r-- | asmcomp/liveness.ml | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/asmcomp/liveness.ml b/asmcomp/liveness.ml index e289b4648f..0bba1cdde3 100644 --- a/asmcomp/liveness.ml +++ b/asmcomp/liveness.ml @@ -62,10 +62,12 @@ let rec live i finally = let across_after = Reg.diff_set_array after i.res in let across = match op with - | Icall_ind _ | Icall_imm _ | Iextcall _ + | Icall_ind _ | Icall_imm _ | Iextcall _ | Ialloc _ | Iintop (Icheckbound _) | Iintop_imm(Icheckbound _, _) -> (* The function call may raise an exception, branching to the - nearest enclosing try ... with. Similarly for bounds checks. + nearest enclosing try ... with. Similarly for bounds checks + and allocation (for the latter: finalizers may throw + exceptions, as may signal handlers). Hence, everything that must be live at the beginning of the exception handler must also be live across this instr. *) Reg.Set.union across_after !live_at_raise |