From 86b21447e77052598ff93b6aa0b2db3ccda45d76 Mon Sep 17 00:00:00 2001 From: Ian Lance Taylor Date: Sun, 12 Sep 1999 14:27:21 +0000 Subject: 1999-09-12 Donn Terry * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most significant bit is set. --- bfd/ChangeLog | 5 +++++ bfd/libbfd.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'bfd') diff --git a/bfd/ChangeLog b/bfd/ChangeLog index bf74059..7d00945 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +1999-09-12 Donn Terry + + * libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most + significant bit is set. + 1999-09-11 Ian Lance Taylor * coff-ppc.c (COFF_SECTION_ALIGNMENT_ENTRIES): Define. diff --git a/bfd/libbfd.c b/bfd/libbfd.c index d2baa5b..9620cda 100644 --- a/bfd/libbfd.c +++ b/bfd/libbfd.c @@ -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; } -- cgit v1.1