QBenchmarkResult: fix uninitialized value

This manifested itself in a UBSan report about loading a non-enumerated
value from an enumeration variable:

   src/testlib/qbenchmark_p.h:95:7: runtime error: load of value 11091, which is not a valid value for type 'QBenchmarkMetric'

(or similar).

The chosen value is simply QTest::QBenchmarkMetric(0).

Change-Id: I8492a871a71d89fa6f7902d38f9eecee4b060646
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
bb10
Marc Mutz 2015-01-18 13:34:59 +01:00
parent 7fc8c560e2
commit b18e6396bd
1 changed files with 1 additions and 0 deletions

View File

@ -105,6 +105,7 @@ public:
QBenchmarkResult()
: value(-1)
, iterations(-1)
, metric(QTest::FramesPerSecond)
, setByMacro(true)
, valid(false)
{ }