[UBsan] Fixed int overflow
authorkhizmax <libcds.dev@gmail.com>
Sun, 5 Mar 2017 08:21:22 +0000 (11:21 +0300)
committerkhizmax <libcds.dev@gmail.com>
Sun, 5 Mar 2017 08:21:22 +0000 (11:21 +0300)
projects/Win/vc14/cds.sln
test/include/cds_test/fc_hevy_value.h

index 4734338..8672553 100644 (file)
@@ -18,6 +18,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "cds_test", "cds_test", "{3A
        ProjectSection(SolutionItems) = preProject\r
                ..\..\..\test\include\cds_test\check_size.h = ..\..\..\test\include\cds_test\check_size.h\r
                ..\..\..\test\include\cds_test\city.h = ..\..\..\test\include\cds_test\city.h\r
+               ..\..\..\test\include\cds_test\fc_hevy_value.h = ..\..\..\test\include\cds_test\fc_hevy_value.h\r
                ..\..\..\test\include\cds_test\fixture.h = ..\..\..\test\include\cds_test\fixture.h\r
                ..\..\..\test\include\cds_test\hash_func.h = ..\..\..\test\include\cds_test\hash_func.h\r
                ..\..\..\test\include\cds_test\stat_bronson_avltree_out.h = ..\..\..\test\include\cds_test\stat_bronson_avltree_out.h\r
index 9208a11..b17fd2a 100644 (file)
@@ -54,7 +54,7 @@ namespace fc_test {
             , nWriterNo(other.nWriterNo)
         {
             for(size_t i = 0; i < buffer_size; ++i)
-                pop_buff[i] =  static_cast<int>(std::sqrt(other.pop_buff[i]*rand()));
+                pop_buff[i] =  static_cast<int>(std::sqrt( static_cast<int>( pop_buff[i] * rand())));
         }
 
         void set_array(size_t new_size)