From 585e9d49851a0dd81932d96c43dabc32bad487b9 Mon Sep 17 00:00:00 2001 From: Eric Pouech Date: Mon, 15 Jan 2024 11:55:36 +0100 Subject: [PATCH] dbghelp: Support redefinition of a range statement. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56168 Signed-off-by: Eric Pouech --- dlls/dbghelp/stabs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/dlls/dbghelp/stabs.c b/dlls/dbghelp/stabs.c index 552b334f2da..20d5623f391 100644 --- a/dlls/dbghelp/stabs.c +++ b/dlls/dbghelp/stabs.c @@ -819,9 +819,15 @@ static int stabs_pts_read_type_def(struct ParseTypedefData* ptd, const char* typ PTS_ABORTIF(ptd, stabs_pts_read_array(ptd, &new_dt) == -1); break; case 'r': - PTS_ABORTIF(ptd, stabs_pts_read_range(ptd, typename, &new_dt) == -1); - assert(!*stabs_find_ref(filenr1, subnr1)); - *stabs_find_ref(filenr1, subnr1) = new_dt; + { + struct symt** prev_dt; + PTS_ABORTIF(ptd, stabs_pts_read_range(ptd, typename, &new_dt) == -1); + + prev_dt = stabs_find_ref(filenr1, subnr1); + /* allow redefining with same base type */ + if (*prev_dt && *prev_dt != new_dt) WARN("Multiple range def in %ls\n", ptd->module->module.ModuleName); + else *prev_dt = new_dt; + } break; case 'f': PTS_ABORTIF(ptd, stabs_pts_read_type_def(ptd, NULL, &ref_dt) == -1);