This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH ] PR libstdc++/60037 - SIGFPE in std::generate_canonical<unsigned int...>


As discussed in the audit trail both _Adaptor and generate_canonical are both meant to use floating point values. Both are here given static_asserts to that effect.
This would have prevented this error and might help future users.

The main issue is the use of value_type in _Adaptor and thus in generate_canonical in hypergeometric_distribution::operator(). This distribution is a discreet distribution and thus value_type is an unsigned integer which caused overflow in generate_canonical. In keeping with practice in all other discreet distributions a double type will now be used in _Adaptor.

Someday, it might be beneficial to discuss an _IntegralAdaptor and a corresponding __generate_canonical for use in our discreet distributions but I want to close this bug with this patch.

Built and tested on x86_64-linux.

OK?

Attachment: CL_pr60037
Description: Text document

Attachment: patch_pr60037
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]