[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.
authorTim Shen <timshen91@gmail.com>
Fri, 16 Feb 2018 01:44:36 +0000 (01:44 +0000)
committerTim Shen <timshen91@gmail.com>
Fri, 16 Feb 2018 01:44:36 +0000 (01:44 +0000)
commit89337750a0286ac970738ac22a8462d82008b09f
tree53c022d3515c555a21e64beea4c972802096470c
parent3dc6de619a7a5778c1338187d3181ac5613b3959
[APInt] Fix extractBits to correctly handle Result.isSingleWord() case.

Summary: extractBits assumes that `!this->isSingleWord() implies !Result.isSingleWord()`, which may not necessarily be true. Handle both cases.

Reviewers: RKSimon

Subscribers: sanjoy, llvm-commits, hiraditya

Differential Revision: https://reviews.llvm.org/D43363

llvm-svn: 325311
llvm/lib/Support/APInt.cpp
llvm/unittests/ADT/APIntTest.cpp