瀏覽代碼

GC fix in Context.signature

Nicolas Cannasse 11 年之前
父節點
當前提交
0e02a748bf
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      interp.ml

+ 3 - 0
interp.ml

@@ -2273,6 +2273,9 @@ let macro_lib =
 				| VClosure (vl,f) ->
 					let rl = ref [] in
 					let v2 = VClosure (Obj.magic rl, Obj.magic !cache_count) in
+					(* in ocaml 4.0+ it was reported some stack overflow, related to vl being GC'ed or mutated in do_cache.
+					   let's make sure to have a real pointer to it first. The fix will trigger an alloc which might have simply moved the problem away *)
+					let vl = VNull :: vl in
 					do_cache v v2;
 					rl := List.map loop vl;
 					v2