You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by pe...@apache.org on 2026/07/25 17:06:35 UTC
(openoffice) 01/03: crashrep: arch-guard dwRelOffset so x86 keeps building (Win64 regression)
This is an automated email from the ASF dual-hosted git repository.
leginee pushed a commit to branch bazel-migration
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 4eacc145a1370da7bc62c999e62d01503b1227eb
Author: Peter Kovacs <pe...@apache.org>
AuthorDate: Sat Jul 25 19:05:50 2026 +0200
crashrep: arch-guard dwRelOffset so x86 keeps building (Win64 regression)
Win64 commit d14d772a5b changed `DWORD dwRelOffset` to `DWORD64`
unconditionally in WriteStackFile(). That is required on x64 (where the
dbghelp macro maps SymGetSymFromAddr to SymGetSymFromAddr64, whose
displacement parameter is PDWORD64) but breaks the x86 build, where the
non-64 SymGetSymFromAddr wants a PDWORD:
soreport.cpp(1789) : error C2664: 'SymGetSymFromAddr' : cannot convert
parameter 3 from 'DWORD64 *' to 'PDWORD'
Select the displacement type per architecture with the same INTEL/X86_64
guard the commit already uses for the CONTEXT.Eip/Rip assignment a few
lines above, so both x86 (DWORD) and x64 (DWORD64) compile.
Pure source fix, backportable to the dmake tree.
Co-Authored-By: Claude Opus 4.8 <no...@anthropic.com>
---
main/crashrep/source/win32/soreport.cpp | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/main/crashrep/source/win32/soreport.cpp b/main/crashrep/source/win32/soreport.cpp
index 3059ec481c..850f5111bb 100644
--- a/main/crashrep/source/win32/soreport.cpp
+++ b/main/crashrep/source/win32/soreport.cpp
@@ -1778,7 +1778,18 @@ static bool WriteStackFile( FILE *fout, hash_map< string, string >& rLibraries,
{
rLibraries[ GetFileName( moduleInfo.LoadedImageName ).c_str() ] = moduleInfo.LoadedImageName;
+ // SymGetSymFromAddr's displacement parameter is arch-dependent:
+ // on x86 it is PDWORD, on x64 the dbghelp macro maps it to
+ // SymGetSymFromAddr64 wanting PDWORD64. Match the type per arch
+ // (same INTEL/X86_64 guard used for AddrPC.Offset above); an
+ // unconditional DWORD64 breaks the x86 build (C2664).
+#if defined(INTEL)
+ DWORD dwRelOffset = 0;
+#elif defined(X86_64)
DWORD64 dwRelOffset = 0;
+#else
+#error Unsupported architecture
+#endif
BYTE symbolBuffer[sizeof(IMAGEHLP_SYMBOL) + 256 ];
PIMAGEHLP_SYMBOL pSymbol = (PIMAGEHLP_SYMBOL)symbolBuffer;