1999-09-12 Donn Terry <donn@interix.com>

* libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most
	significant bit is set.
This commit is contained in:
Ian Lance Taylor 1999-09-12 14:27:21 +00:00
parent 61feeec2ee
commit 86b21447e7
2 changed files with 6 additions and 1 deletions

View File

@ -1,3 +1,8 @@
1999-09-12 Donn Terry <donn@interix.com>
* libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most
significant bit is set.
1999-09-11 Ian Lance Taylor <ian@zembu.com>
* coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define.

View File

@ -1260,7 +1260,7 @@ bfd_log2 (x)
{
unsigned int result = 0;
while ((((bfd_vma) 1) << result) < x)
while ((x = (x >> 1)) != 0)
++result;
return result;
}