ADT: Correct APInt::getActiveWords for zero values
authorMeador Inge <meadori@codesourcery.com>
Thu, 7 Feb 2013 18:36:50 +0000 (18:36 +0000)
committerMeador Inge <meadori@codesourcery.com>
Thu, 7 Feb 2013 18:36:50 +0000 (18:36 +0000)
commit32dc72492058af532fd6cfd9e5cf6364d6b421db
treec19aad55a649d61f8e5ac38cfa1f2be92f6be65f
parentb31d71367bac0896dbde0f93a939ec7da19a7bf8
ADT: Correct APInt::getActiveWords for zero values

PR15138 was opened because of a segfault in the Bitcode writer.
The actual issue ended up being a bug in APInt where calls to
APInt::getActiveWords returns a bogus value when the APInt value
is 0.  This patch fixes the problem by ensuring that getActiveWords
returns 1 for 0 valued APInts.

llvm-svn: 174641
llvm/include/llvm/ADT/APInt.h
llvm/unittests/ADT/APIntTest.cpp