From 769a6f24c60e7a4d55560025554796ba4be19d03 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 12 Aug 2012 17:01:44 +0100 Subject: ocaml: Use Store_field macro instead of caml_modify. Use the safer, higher level Store_field macro when constructing arrays of structs to return. I don't know if it is strictly necessary in this case, but it's safer. --- generator/generator_ocaml.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/generator/generator_ocaml.ml b/generator/generator_ocaml.ml index 99a0fc6b..db316550 100644 --- a/generator/generator_ocaml.ml +++ b/generator/generator_ocaml.ml @@ -361,7 +361,7 @@ copy_table (char * const * argv) pr " rv = caml_alloc (%ss->len, 0);\n" typ; pr " for (i = 0; i < %ss->len; ++i) {\n" typ; pr " v = copy_%s (&%ss->val[i]);\n" typ typ; - pr " caml_modify (&Field (rv, i), v);\n"; + pr " Store_field (rv, i, v);\n"; pr " }\n"; pr " CAMLreturn (rv);\n"; pr " }\n"; -- cgit