summaryrefslogtreecommitdiff
path: root/src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2020-11-20 14:46:10 +0100
committerJarek Kobus <jaroslaw.kobus@qt.io>2020-11-20 15:09:48 +0000
commit01331893adf91a3bb96152b65dc113fd57cb8ed2 (patch)
tree81a23964a44ca1afc3834d136aa6d23f4bed0521 /src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp
parent2241e45891cae7a95becc5d0b1f8fc09528f2d15 (diff)
downloadqt-creator-01331893adf91a3bb96152b65dc113fd57cb8ed2.tar.gz
Don't call virtual method from Exception c'tor
In case a static s_shouldAssert is true, we were calling virtual description() method from the c'tor of base Exception class, which was reimplemented in subclasses. This could cause a crash, since reimplementations were using not initialized yet private fields. We fix it by de-virtualizing the description() method and instead we pass the description in overloaded, protected c'tors. Original c'tors still use the default description that was used for base Exception class. In addition we make all private fields const, and make showException method non-virtual, as it didn't have any overrides. Change-Id: I7ebae1809ab423e990276e500f9c0db569d10e2d Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Diffstat (limited to 'src/plugins/cppcheck/cppcheckdiagnosticsmodel.cpp')
0 files changed, 0 insertions, 0 deletions