From e67bfd93f1cff7eedcc64dfc7b62cc771dd7bcd9 Mon Sep 17 00:00:00 2001 From: HÃ¥vard Pettersen Date: Wed, 22 Jun 2022 14:30:44 +0000 Subject: add comment --- vespalib/src/vespa/vespalib/stllike/asciistream.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp index c8ff6f4dd4b..caacec196bd 100644 --- a/vespalib/src/vespa/vespalib/stllike/asciistream.cpp +++ b/vespalib/src/vespa/vespalib/stllike/asciistream.cpp @@ -433,6 +433,8 @@ unsigned long long normalize(long long v, bool &negative) { if (v < 0) { negative = true; if (v == std::numeric_limits::min()) { + // according to UBSAN: + // negation of -9223372036854775808 cannot be represented in type 'long long int'; cast to an unsigned type to negate this value to itself return v; } return -v; -- cgit v1.2.3