[OCaml] Fix possible GC issues in generated director code

Make `classDirectorMethod()` generate `CAMLreturn_type()` or
`CAMLreturn0` when there are local variables of type `value`.
This commit is contained in:
Zackery Spytz 2019-02-07 22:08:10 -07:00
commit 28a846705f
2 changed files with 23 additions and 5 deletions

View file

@ -0,0 +1,15 @@
open Swig
open Director_unroll
let director_unroll_MyFoo ob meth args =
match meth with
| "ping" -> C_string "MyFoo::ping()"
| _ -> (invoke ob) meth args
let a = new_derived_object
new_Foo (director_unroll_MyFoo) '()
let b = new_Bar '()
let _ = b -> set (a)
let c = b -> get ()
let _ = assert ((a -> "&" () as int) = (c -> "&" () as int))