diff options
author | Ian Lance Taylor <ian@airs.com> | 1999-09-12 14:27:21 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@airs.com> | 1999-09-12 14:27:21 +0000 |
commit | 86b21447e77052598ff93b6aa0b2db3ccda45d76 (patch) | |
tree | 3cb6c47706e9d24c306b35214258dcaac3126250 /bfd/libbfd.c | |
parent | 61feeec2ee170d8507b75181bb683b6e63ea5610 (diff) | |
download | gdb-86b21447e77052598ff93b6aa0b2db3ccda45d76.zip gdb-86b21447e77052598ff93b6aa0b2db3ccda45d76.tar.gz gdb-86b21447e77052598ff93b6aa0b2db3ccda45d76.tar.bz2 |
1999-09-12 Donn Terry <donn@interix.com>
* libbfd.c (bfd_log2): Rewrite to avoid infinite loop if most
significant bit is set.
Diffstat (limited to 'bfd/libbfd.c')
-rw-r--r-- | bfd/libbfd.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |