Skip to content
Commit 073af74e authored by Michael Gottesman's avatar Michael Gottesman
Browse files

[APInt] Fixed bug where APInt(UINT32_MAX, 0) would blow up when being constructed.

This was due to arithmetic overflow in the getNumBits() computation. Now we
cast BitWidth to a uint64_t so that does not occur during the computation. After
the computation is complete, the uint64_t is truncated when the function
returns.

I know that this is not something that is likely to happen, but it *IS* a valid
input and we should not blow up.

llvm-svn: 199609
parent b80e1699
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment