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

Unified Diff: src/jsregexp.cc

Issue 19749: Fix http://code.google.com/p/chromium/issues/detail?id=7258 crash in IsFlat.... (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 11 years, 11 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: src/jsregexp.cc
===================================================================
--- src/jsregexp.cc (revision 1181)
+++ src/jsregexp.cc (working copy)
@@ -672,8 +672,7 @@
JSRegExp::Flags flags = re->GetFlags();
Handle<String> pattern(re->Pattern());
- StringShape shape(*pattern);
- if (!pattern->IsFlat(shape)) {
+ if (!pattern->IsFlat(StringShape(*pattern))) {
FlattenString(pattern);
}
@@ -783,8 +782,7 @@
Handle<String> subject) {
ASSERT_EQ(regexp->TypeTag(), JSRegExp::IRREGEXP);
- StringShape shape(*subject);
- bool is_ascii = shape.IsAsciiRepresentation();
+ bool is_ascii = StringShape(*subject).IsAsciiRepresentation();
Handle<FixedArray> irregexp = GetCompiledIrregexp(regexp, is_ascii);
if (irregexp.is_null()) {
return Handle<Object>::null();
@@ -800,7 +798,7 @@
int i = 0;
Handle<Object> matches;
- if (!subject->IsFlat(shape)) {
+ if (!subject->IsFlat(StringShape(*subject))) {
FlattenString(subject);
}
« 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