diff options
author | Richard W.M. Jones <rjones@redhat.com> | 2012-08-12 17:01:44 +0100 |
---|---|---|
committer | Richard W.M. Jones <rjones@redhat.com> | 2012-08-12 17:03:24 +0100 |
commit | 769a6f24c60e7a4d55560025554796ba4be19d03 (patch) | |
tree | 041ac5ebd2aba950786e5bf9769a92722938b1f9 | |
parent | 2c046c0d6fb2faccc2b2d5596d0af1c8d043eb76 (diff) | |
download | libguestfs-769a6f24c60e7a4d55560025554796ba4be19d03.tar.gz libguestfs-769a6f24c60e7a4d55560025554796ba4be19d03.tar.xz libguestfs-769a6f24c60e7a4d55560025554796ba4be19d03.zip |
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.
-rw-r--r-- | generator/generator_ocaml.ml | 2 |
1 files changed, 1 insertions, 1 deletions
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"; |