From 4b7d253c8ab5225862e3ac4d443198e4d93072b6 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sun, 21 Jun 2020 13:51:51 +0300 Subject: [PATCH] Fix clang-static-analyzer --- src/IO/readDecimalText.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/IO/readDecimalText.h b/src/IO/readDecimalText.h index f552ec9e531..44405357a10 100644 --- a/src/IO/readDecimalText.h +++ b/src/IO/readDecimalText.h @@ -161,7 +161,9 @@ inline void readDecimalText(ReadBuffer & buf, T & x, uint32_t precision, uint32_ if (static_cast(scale) + exponent < 0) { /// Too many digits after point. Just cut off excessive digits. - x.value /= intExp10OfSize(-exponent - static_cast(scale)); + auto divisor = intExp10OfSize(-exponent - static_cast(scale)); + assert(divisor > 0); /// This is for Clang Static Analyzer. It is not smart enough to infer it automatically. + x.value /= divisor; scale = 0; return; }