From 8cdffd7c5765960ded22169a667e351bb4adc193 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dziepak?= Date: Wed, 25 Jan 2017 15:52:39 +0000 Subject: [PATCH] time_type_impl: value initialize result parse_time() adds hourse, minutes, etc to a final value 'result'. However, it is of type std::chrono::nanoseconds which means it is not zeroed at initialization unless it is explicitly asked to do so. Fixed debug mode failures in types_tyes and cql_query_test. Message-Id: <20170125155239.1253-1-pdziepak@scylladb.com> --- types.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types.cc b/types.cc index d58f8c4fc2..c39980c611 100644 --- a/types.cc +++ b/types.cc @@ -942,7 +942,7 @@ struct time_type_impl : public simple_type_impl { throw marshal_exception("Nanosecond out of bounds."); } } - std::chrono::nanoseconds result; + std::chrono::nanoseconds result{}; result += std::chrono::hours(hours); result += std::chrono::minutes(minutes); result += std::chrono::seconds(seconds);