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

Side by Side Diff: src/ast.cc

Issue 22815033: Fix crash due RegExpAtom method called on RegExpCharacterClass object. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 944 matching lines...) Expand 10 before | Expand all | Expand 10 after
955 for (int i = 0; i < chardata.length(); i++) { 955 for (int i = 0; i < chardata.length(); i++) {
956 stream()->Add("%k", chardata[i]); 956 stream()->Add("%k", chardata[i]);
957 } 957 }
958 stream()->Add("'"); 958 stream()->Add("'");
959 return NULL; 959 return NULL;
960 } 960 }
961 961
962 962
963 void* RegExpUnparser::VisitText(RegExpText* that, void* data) { 963 void* RegExpUnparser::VisitText(RegExpText* that, void* data) {
964 if (that->elements()->length() == 1) { 964 if (that->elements()->length() == 1) {
965 that->elements()->at(0).data.u_atom->Accept(this, data); 965 that->elements()->at(0).tree()->Accept(this, data);
966 } else { 966 } else {
967 stream()->Add("(!"); 967 stream()->Add("(!");
968 for (int i = 0; i < that->elements()->length(); i++) { 968 for (int i = 0; i < that->elements()->length(); i++) {
969 stream()->Add(" "); 969 stream()->Add(" ");
970 that->elements()->at(i).data.u_atom->Accept(this, data); 970 that->elements()->at(i).tree()->Accept(this, data);
971 } 971 }
972 stream()->Add(")"); 972 stream()->Add(")");
973 } 973 }
974 return NULL; 974 return NULL;
975 } 975 }
976 976
977 977
978 void* RegExpUnparser::VisitQuantifier(RegExpQuantifier* that, void* data) { 978 void* RegExpUnparser::VisitQuantifier(RegExpQuantifier* that, void* data) {
979 stream()->Add("(# %i ", that->min()); 979 stream()->Add("(# %i ", that->min());
980 if (that->max() == RegExpTree::kInfinity) { 980 if (that->max() == RegExpTree::kInfinity) {
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value()); 1191 OS::SNPrintF(buffer, "%d", Smi::cast(*value_)->value());
1192 str = arr; 1192 str = arr;
1193 } else { 1193 } else {
1194 str = DoubleToCString(value_->Number(), buffer); 1194 str = DoubleToCString(value_->Number(), buffer);
1195 } 1195 }
1196 return factory->NewStringFromAscii(CStrVector(str)); 1196 return factory->NewStringFromAscii(CStrVector(str));
1197 } 1197 }
1198 1198
1199 1199
1200 } } // namespace v8::internal 1200 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/jsregexp.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698