From df284badac17a538144f6af7a2a6065f0ebe0734 Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 22 Jul 2021 16:24:42 +0800 Subject: [PATCH] [TD-5474] fix runtime error --- src/common/src/ttypes.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/common/src/ttypes.c b/src/common/src/ttypes.c index 6021a8f579..13bcfe6480 100644 --- a/src/common/src/ttypes.c +++ b/src/common/src/ttypes.c @@ -38,7 +38,11 @@ const int32_t TYPE_BYTES[15] = { #define DO_STATICS(__sum, __min, __max, __minIndex, __maxIndex, _list, _index) \ do { \ - (__sum) += (_list)[(_index)]; \ + if (_list[(_index)] >= (INT64_MAX - (__sum))) { \ + __sum = INT64_MAX; \ + } else { \ + (__sum) += (_list)[(_index)]; \ + } \ if ((__min) > (_list)[(_index)]) { \ (__min) = (_list)[(_index)]; \ (__minIndex) = (_index); \ -- GitLab