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

Unified Diff: src/hydrogen.cc

Issue 222113002: Fix HGraphBuilder::BuildAddStringLengths (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 9 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-crbug-357052.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/hydrogen.cc
diff --git a/src/hydrogen.cc b/src/hydrogen.cc
index 24c2ab40b64445905df381b9213a3e8695b97b36..6587ce97199ca944f8daaa8938bcbf73b23f6414 100644
--- a/src/hydrogen.cc
+++ b/src/hydrogen.cc
@@ -1794,7 +1794,8 @@ HValue* HGraphBuilder::BuildAddStringLengths(HValue* left_length,
HValue* right_length) {
// Compute the combined string length and check against max string length.
HValue* length = AddUncasted<HAdd>(left_length, right_length);
- HValue* max_length = Add<HConstant>(String::kMaxLength);
+ // Check that length <= kMaxLength <=> length < MaxLength + 1.
+ HValue* max_length = Add<HConstant>(String::kMaxLength + 1);
Add<HBoundsCheck>(length, max_length);
return length;
}
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-crbug-357052.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698