summaryrefslogtreecommitdiffstats
path: root/libcxx/include/__bit_reference
diff options
context:
space:
mode:
authorHoward Hinnant <hhinnant@apple.com>2012-05-31 23:12:03 +0000
committerHoward Hinnant <hhinnant@apple.com>2012-05-31 23:12:03 +0000
commit4c0de496a07bff47c174841d422b20b28631b668 (patch)
tree9acc23ea0e00f4a02d4ab9c13331b4458b3e48b8 /libcxx/include/__bit_reference
parente48fb7d7323d70d000e262bbe5b0174839ab0bdc (diff)
downloadbcm5719-llvm-4c0de496a07bff47c174841d422b20b28631b668.tar.gz
bcm5719-llvm-4c0de496a07bff47c174841d422b20b28631b668.zip
Fix dangling else clause. Bug found and fixed by Dimitry Andric.
llvm-svn: 157779
Diffstat (limited to 'libcxx/include/__bit_reference')
-rw-r--r--libcxx/include/__bit_reference4
1 files changed, 4 insertions, 0 deletions
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 28dedfd85a3..21ce11f558d 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -950,11 +950,15 @@ __equal_unaligned(__bit_iterator<_Cp, true> __first1, __bit_iterator<_Cp, true>
__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;
OpenPOWER on IntegriCloud