mirror of
https://github.com/gcc-mirror/gcc.git
synced 2024-11-21 13:40:47 +00:00
gccrs: libproc_macro: Copy ffistring data from source
Data from source pointer were not copied correctly in the ffistring constructor. libgrust/ChangeLog: * libproc_macro/ffistring.cc (FFIString::make_ffistring): Add copy from source pointer. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
parent
4689998556
commit
9fc94c1562
@ -41,7 +41,8 @@ FFIString::make_ffistring (const std::string &str)
|
||||
FFIString
|
||||
FFIString::make_ffistring (const unsigned char *data, std::uint64_t len)
|
||||
{
|
||||
const unsigned char *inner = new unsigned char[len];
|
||||
unsigned char *inner = new unsigned char[len];
|
||||
std::memcpy (inner, data, len);
|
||||
return {inner, len};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user