intel / yarpgen

Yet Another Random Program Generator
Other
485 stars 53 forks source link

Unsigned long long generator fix #134

Closed Xazax-hun closed 3 years ago

Xazax-hun commented 3 years ago

Currently, the random value generator is using a long long uniform distribution. Unfortunately, this is not correct for some types, like unsigned long long. The problem is, the numeric_limits<unsigned long long>::max() value cannot be represented as long long, and the following assertion will fire in STL: https://github.com/microsoft/STL/blob/68b344c9dcda6ddf1a8fca112cb9033f9e50e787/stl/inc/random#L1758

I added a getRandUnsignedValue function with unsigned long long uniform distribution to remedy the problem. Let me know if you had something else in mind.