mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
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:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user