Skip to content

Commit 0913a51

Browse files
committed
Merge pull request danmar#469 from lasergnu/SEGV
Fix SEGV on Solaris x86
2 parents f926958 + f7eeb82 commit 0913a51

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

lib/check.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,7 @@ void Check::reportError(const ErrorLogger::ErrorMessage &errmsg)
4242
{
4343
std::cout << errmsg.toXML(true, 1) << std::endl;
4444
}
45+
std::list<Check *> &Check::instances() {
46+
static std::list<Check *> *_instances= new std::list<Check *>;
47+
return *_instances;
48+
}

lib/check.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,7 @@ class CPPCHECKLIB Check {
5353
}
5454

5555
/** List of registered check classes. This is used by Cppcheck to run checks and generate documentation */
56-
static std::list<Check *> &instances() {
57-
static std::list<Check *> _instances;
58-
return _instances;
59-
}
56+
static std::list<Check *> &instances();
6057

6158
/** run checks, the token list is not simplified */
6259
virtual void runChecks(const Tokenizer *, const Settings *, ErrorLogger *) {

0 commit comments

Comments
 (0)