mirror of
https://github.com/topjohnwu/cxx.git
synced 2025-02-12 11:31:42 +00:00
Mark error conversion function noexcept
This prevents a std::bad_alloc exception from operator new[] from potentially propagating into Rust, which would be UB.
This commit is contained in:
parent
0194dc5947
commit
dc2d4c3747
@ -351,7 +351,7 @@ static_assert(!std::is_same<Vec<std::uint8_t>::const_iterator,
|
||||
"Vec<T>::const_iterator != Vec<T>::iterator");
|
||||
|
||||
extern "C" {
|
||||
const char *cxxbridge1$error(const char *ptr, std::size_t len) {
|
||||
const char *cxxbridge1$error(const char *ptr, std::size_t len) noexcept {
|
||||
char *copy = new char[len];
|
||||
std::strncpy(copy, ptr, len);
|
||||
return copy;
|
||||
|
Loading…
x
Reference in New Issue
Block a user