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-30 21:59:13 +0100 |
commit | 8fbc5dc4767e788723e911f792534cdea9c1e5a5 (patch) | |
tree | dd44a0c032db8677cd06a25b2f85a2469e1c8b9d | |
parent | 5d9e403aa48255891f7e799e332e0a95b7648dde (diff) | |
download | libguestfs-8fbc5dc4767e788723e911f792534cdea9c1e5a5.tar.gz libguestfs-8fbc5dc4767e788723e911f792534cdea9c1e5a5.tar.xz libguestfs-8fbc5dc4767e788723e911f792534cdea9c1e5a5.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.
(cherry picked from commit 769a6f24c60e7a4d55560025554796ba4be19d03)
-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 23535924..a2b5aca6 100644 --- a/generator/generator_ocaml.ml +++ b/generator/generator_ocaml.ml @@ -342,7 +342,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"; |