From 0efec1f5c1791db6df6397de82802230f8189881 Mon Sep 17 00:00:00 2001 From: disinvite Date: Fri, 19 Jan 2024 12:30:16 -0500 Subject: [PATCH] Truncate symbol names to 255 characters when matching --- tools/isledecomp/isledecomp/compare/db.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/isledecomp/isledecomp/compare/db.py b/tools/isledecomp/isledecomp/compare/db.py index dea2b590..43d6811b 100644 --- a/tools/isledecomp/isledecomp/compare/db.py +++ b/tools/isledecomp/isledecomp/compare/db.py @@ -170,6 +170,12 @@ def skip_compare(self, orig: int): def _match_on(self, compare_type: SymbolType, addr: int, name: str) -> bool: # Update the compare_type here too since the marker tells us what we should do + + # Truncate the name to 255 characters. It will not be possible to match a name + # longer than that because MSVC truncates the debug symbols to this length. + # See also: warning C4786. + name = name[:255] + logger.debug("Looking for %s %s", compare_type.name.lower(), name) cur = self._db.execute( """UPDATE `symbols`