Module: wine
Branch: master
Commit: 0fac6bcfa4e607dd7fa475f4663a08bd5c193701
URL: https://gitlab.winehq.org/wine/wine/-/commit/0fac6bcfa4e607dd7fa475f4663a08…
Author: Martin Storsjö <martin(a)martin.st>
Date: Wed May 31 10:07:50 2023 +0300
include: Fix the use of __getReg for aarch64/msvc mode.
Clang requires the __getReg function to be declared in addition to
be declared as an intrinsic with the pragma.
This fixes the following error:
../wine/include/winnt.h:2412:27: error: call to undeclared library function '__getReg' with type 'unsigned long long (int)'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
return (struct _TEB *)__getReg(18);
^
../wine/include/winnt.h:2412:27: note: include the header <intrin.h> or explicitly provide a declaration for '__getReg'
1 error generated.
Signed-off-by: Martin Storsjö <martin(a)martin.st>
---
include/winnt.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/winnt.h b/include/winnt.h
index 0117100a921..409dbceee59 100644
--- a/include/winnt.h
+++ b/include/winnt.h
@@ -2406,6 +2406,7 @@ static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
return __wine_current_teb;
}
#elif defined(__aarch64__) && defined(_MSC_VER)
+unsigned __int64 __getReg(int);
#pragma intrinsic(__getReg)
static FORCEINLINE struct _TEB * WINAPI NtCurrentTeb(void)
{
Module: wine
Branch: master
Commit: 542ccaaf8459133cbb552b7e969d5e1143150eb7
URL: https://gitlab.winehq.org/wine/wine/-/commit/542ccaaf8459133cbb552b7e969d5e…
Author: Eric Pouech <epouech(a)codeweavers.com>
Date: Tue May 30 19:03:08 2023 +0200
dbghelp: Better handle very long C++ qualified identifiers in dwarf.
This fixes some crashes especially when dealing with very long C++ names
(like template classes).
Fortunately, dwarf internals don't require type lookup by name (eg.
on forward declaration), so the impact of thrashing some names is limited.
It's very likely native doesn't store directly these very long names
(it could either store the qualified mangled name - which can be way shorter
for template classes - or use the names in lexical hierarchy: both boil down
to storing less information, and recompute it (unmangle or class hierarchy
walk) upon request).
But this would need a proper C++ support in dbghelp. Not for today.
Signed-off-by: Eric Pouech <epouech(a)codeweavers.com>
---
dlls/dbghelp/dwarf.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/dlls/dbghelp/dwarf.c b/dlls/dbghelp/dwarf.c
index 1402ffcb941..46da2968dbb 100644
--- a/dlls/dbghelp/dwarf.c
+++ b/dlls/dbghelp/dwarf.c
@@ -1177,7 +1177,10 @@ static const char* dwarf2_get_cpp_name(dwarf2_debug_info_t* di, const char* name
}
if (!di->unit_ctx->cpp_name)
+ {
di->unit_ctx->cpp_name = pool_alloc(&di->unit_ctx->pool, MAX_SYM_NAME);
+ if (!di->unit_ctx->cpp_name) return name;
+ }
last = di->unit_ctx->cpp_name + MAX_SYM_NAME - strlen(name) - 1;
strcpy(last, name);
@@ -1194,7 +1197,11 @@ static const char* dwarf2_get_cpp_name(dwarf2_debug_info_t* di, const char* name
{
size_t len = strlen(diname.u.string);
last -= 2 + len;
- if (last < di->unit_ctx->cpp_name) return NULL;
+ if (last < di->unit_ctx->cpp_name)
+ {
+ WARN("Too long C++ qualified identifier for %s... using unqualified identifier\n", name);
+ return name;
+ }
memcpy(last, diname.u.string, len);
last[len] = last[len + 1] = ':';
}