Signed-off-by: Daniel Lehman dlehman25@gmail.com ---
-1 is a valid state, but nothing to unwind
sample: cl /EHa /Od /MD test.cpp
try { std::wstring value(L""); value = value.substr(std::wstring::npos, 1); } catch (std::exception) { printf("catch\n"); } --- dlls/vcruntime140_1/except_x86_64.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c index b0c494ce1c..ef171a5f6c 100644 --- a/dlls/vcruntime140_1/except_x86_64.c +++ b/dlls/vcruntime140_1/except_x86_64.c @@ -416,6 +416,9 @@ static void cxx_local_unwind4(ULONG64 frame, DISPATCHER_CONTEXT *dispatch,
TRACE("current level: %d, last level: %d\n", trylevel, last_level);
+ if (trylevel==-1) + return; + if (trylevel<0 || trylevel>=descr->unwind_count) { ERR("invalid trylevel %d\n", trylevel);