Fix other part of #8710.
- 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.
This commit is contained in:
parent
aeadcf457d
commit
95453175cd
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user