mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-29 11:10:40 +00:00
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>
This commit is contained in:
committed by
Avi Kivity
parent
034d028329
commit
8cdffd7c57
2
types.cc
2
types.cc
@@ -942,7 +942,7 @@ struct time_type_impl : public simple_type_impl<int64_t> {
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user