diff options
author | Richard Trieu <rtrieu@google.com> | 2018-09-05 04:19:15 +0000 |
---|---|---|
committer | Richard Trieu <rtrieu@google.com> | 2018-09-05 04:19:15 +0000 |
commit | 47c2bc58b3d6142ff3400846bd847620d0a58548 (patch) | |
tree | f1f13e17002e0c10fa38303dd4b270a92e6c9ef9 /lldb/scripts/Python | |
parent | c8f348cba7035286ab49d3a2e5d82439ffd814ec (diff) | |
download | llvm-47c2bc58b3d6142ff3400846bd847620d0a58548.zip llvm-47c2bc58b3d6142ff3400846bd847620d0a58548.tar.gz llvm-47c2bc58b3d6142ff3400846bd847620d0a58548.tar.bz2 |
Prevent unsigned overflow.
The sum of the weights is caculated in an APInt, which has a width smaller than
64. In certain cases, the sum of the widths would overflow when calculations
are done inside an APInt, but would not if done with uint64_t. Since the
values will be passed as uint64_t in the function call anyways, do all the math
in 64 bits. Also added an assert in case the probabilities overflow 64 bits.
llvm-svn: 341444
Diffstat (limited to 'lldb/scripts/Python')
0 files changed, 0 insertions, 0 deletions