-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Segfault in Weak.get_copy with Infix_tag #9485
Copy link
Copy link
Closed
Description
The implementation of Weak.get_copy is missing the special case necessary to handle Infix_tag, so it can corrupt memory:
OCaml version 4.10.0
# let w = Weak.create 1 in
let rec f () = g () and g () = f () in
Weak.set w 0 (Some g);
match Weak.get_copy w 0 with Some h -> h () | _ -> ();;
Segmentation fault
I don't think this is particularly urgent to fix, because it's been there a long time without anyone noticing:
Objective Caml version 3.10.2
# let w = Weak.create 1 in
let rec f () = g () and g () = f () in
Weak.set w 0 (Some g);
match Weak.get_copy w 0 with Some h -> h () | _ -> ();;
Segmentation fault
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels