Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@achabense
Copy link
Contributor

@achabense achabense commented Jul 12, 2023

_Current_path is wrongly marked as noexcept, which will cause the program to terminate if resize throws.

STL/stl/inc/filesystem

Lines 4045 to 4046 in 2261f7e

_NODISCARD inline __std_win_error _Current_path(path& _Result) noexcept {
_Result._Text.resize(__std_fs_max_path);

This pr fixes it by merging the function into throwable path current_path(error_code&).

@achabense achabense requested a review from a team as a code owner July 12, 2023 15:44
@StephanTLavavej StephanTLavavej added bug Something isn't working filesystem C++17 filesystem labels Jul 12, 2023
@StephanTLavavej StephanTLavavej self-assigned this Jul 12, 2023
@StephanTLavavej
Copy link
Member

Great catch, thanks! 😻 I couldn't resist pushing a stylistic nitpick even though this resets testing.

@StephanTLavavej
Copy link
Member

I'm speculatively mirroring this to the MSVC-internal repo - please notify me if any further changes are pushed.

@StephanTLavavej StephanTLavavej merged commit f51733c into microsoft:main Jul 14, 2023
@StephanTLavavej
Copy link
Member

Thanks for noticing and fixing this silent bad codegen! 🦅 👁️ ✅

@achabense achabense deleted the _FS_noexcept_fix branch July 14, 2023 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working filesystem C++17 filesystem

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants