You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
geometric_distribution, poisson_distribution, binomial_distribution, and gamma_distribution could cast potentially huge floating point values to an integer type, resulting in UB.
C:\Users\He\source\test>clang++ -O2 -Wall -Wextra -Werror -fsanitize=undefined bad_random.cpp -o bad_random.exe
正在创建库 bad_random.lib 和对象 bad_random.exp
C:\Users\He\source\test>.\bad_random.exe
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2148:33: runtime error: inf is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2148:33 in
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2317:41: runtime error: 2.30959e+17 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2317:41 in
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2500:45: runtime error: 1.15479e+17 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:2500:45 in
C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:3149:40: runtime error: 1e+10 is outside the range of representable values of type 'int'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.27.29109\include\random:3149:40 in
STL version
Microsoft Visual Studio Community 2019 Preview
版本 16.7.0 Preview 5.0
The text was updated successfully, but these errors were encountered:
Describe the bug
geometric_distribution
,poisson_distribution
,binomial_distribution
, andgamma_distribution
could cast potentially huge floating point values to an integer type, resulting in UB.Command-line test case
#include
s tests/std/tests/GH_001017_discrete_distribution_out_of_range/bad_random_engine.hppSTL version
The text was updated successfully, but these errors were encountered: