From 53fbe0bb43d2dd6b083c714beb1d73f39820f9db Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 30 Dec 2019 23:04:10 +0300 Subject: [PATCH] Avoid UBSan report --- dbms/src/Columns/ColumnVector.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/dbms/src/Columns/ColumnVector.h b/dbms/src/Columns/ColumnVector.h index a90f1bdb6e8..a157a184974 100644 --- a/dbms/src/Columns/ColumnVector.h +++ b/dbms/src/Columns/ColumnVector.h @@ -212,21 +212,23 @@ public: Float64 getFloat64(size_t n) const override; Float32 getFloat32(size_t n) const override; - UInt64 getUInt(size_t n) const override + /// Out of range conversion is permitted. + UInt64 NO_SANITIZE_UNDEFINED getUInt(size_t n) const override { return UInt64(data[n]); } + /// Out of range conversion is permitted. + Int64 NO_SANITIZE_UNDEFINED getInt(size_t n) const override + { + return Int64(data[n]); + } + bool getBool(size_t n) const override { return bool(data[n]); } - Int64 getInt(size_t n) const override - { - return Int64(data[n]); - } - void insert(const Field & x) override { data.push_back(DB::get>(x));