Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions stl/inc/xlocinfo
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,12 @@ public:

template <class _Elem2 = _Elem, enable_if_t<is_same_v<_Elem2, char>, int> = 0>
void _From_wide(const wchar_t* const _Right) noexcept {
// CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781
if (reinterpret_cast<wchar_t*>(_Myptr) != _Right) { // new value, discard old and copy new
_Tidy();

if (_Right) { // new is not empty, copy it
// CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781
_Myptr = reinterpret_cast<char*>(_STD _Ntcts_dup_dbg(_Right));
}
}
Expand Down
1 change: 1 addition & 0 deletions stl/src/locale0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,7 @@ void __CLRCALL_PURE_OR_CDECL _Locinfo::_Locinfo_dtor(_Locinfo* pLocinfo) { // de
// so reinterpret_cast is not reliable.
_wsetlocale(LC_ALL, L"");
} else {
// CodeQL [SM02986] We are intentionally storing `wchar_t*` as `char*` due to ABI, see GH-5781
_wsetlocale(LC_ALL, reinterpret_cast<const wchar_t*>(pLocinfo->_Oldlocname._C_str()));
}
}
Expand Down