Skip to content

Commit

Permalink
Fixes #199 ('"Missing/misused m_is_wide in char_wchar_holder assignme…
Browse files Browse the repository at this point in the history
…nt operators").
  • Loading branch information
igaztanaga committed Sep 26, 2024
1 parent a22d498 commit 6c8f351
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 4 additions & 1 deletion doc/interprocess.qbk
Original file line number Diff line number Diff line change
Expand Up @@ -6778,8 +6778,11 @@ thank them:
You can obtain the pre-Boost 1.87 ABI #defining `BOOST_INTERPROCESS_SEGMENT_MANAGER_ABI` to `1` before including Boost.Interprocess headers.

* Fixed bugs:
* [@https://github.com/boostorg/interprocess/issues/210 GitHub #210 (['"Bug in boost::interprocess::ipcdetail::sync_handles::obtain_mutex"])].
* [@https://github.com/boostorg/interprocess/issues/192 GitHub #192 (['"managed_windows_shared_memory crash on destruction"])].
* [@https://github.com/boostorg/interprocess/issues/199 GitHub #199 (['"missing/misused m_is_wide in char_wchar_holder assignment operators"])].
* [@https://github.com/boostorg/interprocess/issues/210 GitHub #210 (['"Bug in boost::interprocess::ipcdetail::sync_handles::obtain_mutex"])].
* [@https://github.com/boostorg/interprocess/issues/215 GitHub #215 (['"Alignment problem with boost/interprocess/segment_manager on SPARC 32Bit"])].


[endsect]

Expand Down
6 changes: 4 additions & 2 deletions include/boost/interprocess/detail/char_wchar_holder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ class char_wchar_holder
this->delete_mem();
m_str.n = tmp;
std::strcpy(m_str.n, nstr);
m_is_wide = false;
return *this;
}

Expand All @@ -66,15 +67,16 @@ class char_wchar_holder
this->delete_mem();
m_str.w = tmp;
std::wcscpy(m_str.w, wstr);
m_is_wide = true;
return *this;
}

char_wchar_holder& operator=(const char_wchar_holder &other)
{
if (other.m_is_wide)
*this = other.getn();
else
*this = other.getw();
else
*this = other.getn();
return *this;
}

Expand Down

0 comments on commit 6c8f351

Please sign in to comment.