1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[OCaml] Fix buildbot failure in OCaml tests

The commit 506df1bbfd16233134a6ddea96ed2d49077840fd introduced
a call to `caml_alloc_initialized_string` which seems to be
unavailable on older OCaml versions. So I'm now switching to
using `caml_alloc_string` and using a `memcpy` after that, as
is done in the rest of the file.

Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/16/builds/7919
This commit is contained in:
Vaivaswatha Nagaraj 2021-03-17 11:25:43 +05:30
parent 45770e01eb
commit 7fbfc910ee

View File

@ -48,7 +48,8 @@ CAMLprim value cstr_to_string(const unsigned char *Str, unsigned Len) {
CAMLparam0();
CAMLlocal1(String);
if (Str) {
String = caml_alloc_initialized_string(Len, Str);
String = caml_alloc_string(Len);
memcpy(String_val(Str), Str, Len);
} else {
String = caml_alloc_string(0);
}