diff options
| author | Rene Gollent <anevilyak@gmail.com> | 2012-07-11 23:39:17 -0400 |
|---|---|---|
| committer | Rene Gollent <anevilyak@gmail.com> | 2012-07-11 23:39:17 -0400 |
| commit | 95453175cda446eb4dede872a5bae561bbde7190 (patch) | |
| tree | caba79d27ad64b53abdd9f1c03775cdd43ef1c60 | |
| parent | aeadcf457d5c91c993dc07f01490723960465e8c (diff) | |
- When binary searching functions in the source entry list,
comparing by name and location alone isn't sufficient, since
templates will match those for different instances, Fixes a crash on
exit where the wrong function would get removed from the list, while
the one we actually wanted to remove was still in the list, but then
had its source code cleared. This would later crash the comparison
function due to not being able to get its source location.
| -rw-r--r-- | src/apps/debugger/debug_info/TeamDebugInfo.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/apps/debugger/debug_info/TeamDebugInfo.cpp b/src/apps/debugger/debug_info/TeamDebugInfo.cpp index b3817fe898..9a22093933 100644 --- a/src/apps/debugger/debug_info/TeamDebugInfo.cpp +++ b/src/apps/debugger/debug_info/TeamDebugInfo.cpp @@ -1,5 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2012, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ @@ -194,7 +195,13 @@ private: if (locationA < locationB) return -1; - return locationA == locationB ? 0 : 1; + if (locationA != locationB ) + return 1; + + // if the locations match we still need to compare by name to be + // certain, since differently typed instantiations of template + // functions will have the same source file and location + return a->Name().Compare(b->Name()); } static int _CompareLocationFunction(const SourceLocation* location, |
