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.
This commit is contained in:
Richard W.M. Jones
2012-08-12 17:01:44 +01:00
parent 2c046c0d6f
commit 769a6f24c6

View File

@@ -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";