[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 473433896b8f1cf9f9d93867048fe4a9b9d972d3..86725534dc8bb0faca58a29795fdca69c52835c1 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 9208a1164d7a7b4c3e536fb25e8c794b7ad566a9..b17fd2a1ab1bb5d0d22109ee0614907762b9b4b4 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)