提交 d7cbeba7 编写于 作者: P Patrick Walton

rustboot: Only bottom out at opaque IL types after finding two cycles. DON'T ASK ME WHY THIS WORKS.

上级 6443179b
......@@ -2425,7 +2425,7 @@ and referent_type
Some parent_tags
when boxed
&& parent_tags <> []
&& List.mem ttag parent_tags
&& (list_count ttag parent_tags) > 1
&& is_back_edge ttag (List.hd parent_tags) ->
Il.StructTy [| word; Il.OpaqueTy |]
| _ -> tag ttag
......
......@@ -380,6 +380,13 @@ let rec list_drop n ls =
else list_drop (n-1) (List.tl ls)
;;
let rec list_count elem lst =
match lst with
[] -> 0
| h::t when h = elem -> 1 + (list_count elem t)
| _::t -> list_count elem t
;;
(*
* Auxiliary pair functions.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册