[cfe-commits] [libcxx] r157779 - /libcxx/trunk/include/__bit_reference
Howard Hinnant
hhinnant at apple.com
Thu May 31 16:12:03 PDT 2012
Author: hhinnant
Date: Thu May 31 18:12:03 2012
New Revision: 157779
URL: http://llvm.org/viewvc/llvm-project?rev=157779&view=rev
Log:
Fix dangling else clause. Bug found and fixed by Dimitry Andric.
Modified:
libcxx/trunk/include/__bit_reference
Modified: libcxx/trunk/include/__bit_reference
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__bit_reference?rev=157779&r1=157778&r2=157779&view=diff
==============================================================================
--- libcxx/trunk/include/__bit_reference (original)
+++ libcxx/trunk/include/__bit_reference Thu May 31 18:12:03 2012
@@ -950,11 +950,15 @@
__storage_type __ddn = _VSTD::min<__storage_type>(__dn, __clz_r);
__m = (~__storage_type(0) << __first2.__ctz_) & (~__storage_type(0) >> (__clz_r - __ddn));
if (__first2.__ctz_ > __first1.__ctz_)
+ {
if ((*__first2.__seg_ & __m) != (__b << (__first2.__ctz_ - __first1.__ctz_)))
return false;
+ }
else
+ {
if ((*__first2.__seg_ & __m) != (__b >> (__first1.__ctz_ - __first2.__ctz_)))
return false;
+ }
__first2.__seg_ += (__ddn + __first2.__ctz_) / __bits_per_word;
__first2.__ctz_ = static_cast<unsigned>((__ddn + __first2.__ctz_) % __bits_per_word);
__dn -= __ddn;
More information about the cfe-commits
mailing list