Signed-off-by: Daniel Lehman dlehman25@gmail.com ---
'last' points to state 0 so the (unwind_data > last) stops too soon and a handler for state 0 is skipped
void throw_int(int x) { test t(0xcafef00d); /* at 0 */ throw x; }
void test_unwind_to_minus_one(void) { try { throw_int(42); } catch(int i) { printf("catch %d\n", i); } } --- dlls/vcruntime140_1/except_x86_64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/vcruntime140_1/except_x86_64.c b/dlls/vcruntime140_1/except_x86_64.c index ef171a5f6c..f10c67c573 100644 --- a/dlls/vcruntime140_1/except_x86_64.c +++ b/dlls/vcruntime140_1/except_x86_64.c @@ -426,7 +426,7 @@ static void cxx_local_unwind4(ULONG64 frame, DISPATCHER_CONTEXT *dispatch, }
unwind_data = rva_to_ptr(descr->unwind_map, dispatch->ImageBase); - last = unwind_data; + last = unwind_data - 1; for (i = 0; i < trylevel; i++) { BYTE *addr = unwind_data;