File: Test148.ML

package info (click to toggle)
polyml 5.6-8
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 31,892 kB
  • ctags: 34,453
  • sloc: cpp: 44,983; ansic: 24,520; asm: 14,850; sh: 11,730; makefile: 551; exp: 484; python: 253; awk: 91; sed: 9
file content (27 lines) | stat: -rw-r--r-- 768 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
(* This caused an InternalError exception during the "open".  The problem was
   that the "garbage-collector" introduced in commit 1893 had a bug where it
   assumed that if it processed the "general" value for a binding the
   binding had been fully processed.  However the "general" value for
   "tuple" is reachable both through the closure of "f" and also through
   the entry in the structure itself but only the latter has the "special"
   entries that refer to the fields. *)


local
   val r : ((int -> int) * (int->int) * int ref * int ref) option ref = ref NONE
in
   fun doDo p = r := SOME p
end;


structure Test =
struct

    val tuple = (fn _ => raise Fail "bad", fn _ => raise Fail "bad", ref 0, ref 0)

    fun f _ = (doDo tuple; 0)

end;

open Test;