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

Unified Diff: src/jsregexp.cc

Issue 140021: Fix regexp bug reported by Ian where [6-9] would match any digit. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 6 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 | test/mjsunit/regress/regress-6-9-regexp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 2224)
+++ src/jsregexp.cc (working copy)
@@ -1885,7 +1885,8 @@
uint32_t differing_bits = (from ^ to);
// A mask and compare is only perfect if the differing bits form a
// number like 00011111 with one single block of trailing 1s.
- if ((differing_bits & (differing_bits + 1)) == 0) {
+ if ((differing_bits & (differing_bits + 1)) == 0 &&
+ from + differing_bits == to) {
pos->determines_perfectly = true;
}
uint32_t common_bits = ~SmearBitsRight(differing_bits);
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-6-9-regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698