[PATCH 5/5] vcruntime140_1: Skip unwind if already at last level.

Daniel Lehman dlehman25 at gmail.com
Tue Jun 2 20:56:17 CDT 2020


Signed-off-by: Daniel Lehman <dlehman25 at gmail.com>
---

nothing to unwind if trylevel is already at the last level.  sample:

void test_same_state(void)
{
    test t(1);
    try
    {
        try
        {
          throw test(0x42);
        } catch (test x) {
          printf("catch %x\n", x.id);
          throw;
        }
    } catch (test x) {
        printf("catch %x\n", x.id);
    }
}
---
 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 f10c67c573..31871c73ec 100644
--- a/dlls/vcruntime140_1/except_x86_64.c
+++ b/dlls/vcruntime140_1/except_x86_64.c
@@ -416,7 +416,7 @@ static void cxx_local_unwind4(ULONG64 frame, DISPATCHER_CONTEXT *dispatch,
 
     TRACE("current level: %d, last level: %d\n", trylevel, last_level);
 
-    if (trylevel==-1)
+    if (trylevel==-1 || trylevel==last_level)
         return;
 
     if (trylevel<0 || trylevel>=descr->unwind_count)
-- 
2.17.1




More information about the wine-devel mailing list