Skip to content

Commit

Permalink
Added attribute to tell ubsan that the RNG's integer overflow is inte…
Browse files Browse the repository at this point in the history
…ntional
azonenberg committed Jul 21, 2017
1 parent 9303e0c commit 8eff19d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/xbpar/PAREngine.cpp
Original file line number Diff line number Diff line change
@@ -45,6 +45,8 @@ PAREngine::~PAREngine()
//A PCG random number generator. PCG was developed by Melissa O'Neill.
//This particular piece of code was stolen from the "simple C implementation."
//See http://www.pcg-random.org for more information
//Unsigned integer overflow here is intentional, so tell ubsan to ignore it
__attribute__((no_sanitize("integer")))
uint32_t PAREngine::RandomNumber()
{
uint64_t oldstate = m_randomState;

0 comments on commit 8eff19d

Please sign in to comment.