From c9519ba382f90ce5f4e4369cf2b6ac2c57a73ff8 Mon Sep 17 00:00:00 2001 From: khizmax Date: Tue, 7 Mar 2017 10:54:20 +0300 Subject: [PATCH] [UBsan] Fixed signed integer overflow --- test/include/cds_test/fc_hevy_value.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/include/cds_test/fc_hevy_value.h b/test/include/cds_test/fc_hevy_value.h index b17fd2a1..4159bd7f 100644 --- a/test/include/cds_test/fc_hevy_value.h +++ b/test/include/cds_test/fc_hevy_value.h @@ -53,8 +53,9 @@ namespace fc_test { , nNo(other.nNo) , nWriterNo(other.nWriterNo) { + // This is an imitation of heavy copy ctor for(size_t i = 0; i < buffer_size; ++i) - pop_buff[i] = static_cast(std::sqrt( static_cast( pop_buff[i] * rand()))); + pop_buff[i] = static_cast( std::sqrt( std::abs( static_cast( pop_buff[i] ) * rand()))); } void set_array(size_t new_size) -- 2.34.1