Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: runtime/vm/bit_vector.cc

Issue 18341023: Removes undefined shifting behavior from BitVector::Equals. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/bit_vector.cc
===================================================================
--- runtime/vm/bit_vector.cc (revision 24832)
+++ runtime/vm/bit_vector.cc (working copy)
@@ -41,8 +41,8 @@
}
if (i < data_length_) {
// Don't compare bits beyond length_.
- uword mask =
- static_cast<uword>(-1) >> (kBitsPerWord - (length_ % kBitsPerWord));
+ const intptr_t shift_size = (kBitsPerWord - length_) & (kBitsPerWord - 1);
+ const uword mask = static_cast<uword>(-1) >> shift_size;
if ((data_[i] & mask) != (other.data_[i] & mask)) return false;
}
return true;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698