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

Side by Side Diff: src/parser.cc

Issue 19663: Regexp parser: Added exception if repetition max < min. (Closed)
Patch Set: Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 3770 matching lines...) Expand 10 before | Expand all | Expand 10 after
3781 max = RegExpTree::kInfinity; 3781 max = RegExpTree::kInfinity;
3782 Advance(); 3782 Advance();
3783 break; 3783 break;
3784 case '?': 3784 case '?':
3785 min = 0; 3785 min = 0;
3786 max = 1; 3786 max = 1;
3787 Advance(); 3787 Advance();
3788 break; 3788 break;
3789 case '{': 3789 case '{':
3790 if (ParseIntervalQuantifier(&min, &max)) { 3790 if (ParseIntervalQuantifier(&min, &max)) {
3791 if (max < min) {
3792 ReportError(CStrVector("numbers out of order in {} quantifier.")
3793 CHECK_FAILED);
3794 }
3791 break; 3795 break;
3792 } else { 3796 } else {
3793 continue; 3797 continue;
3794 } 3798 }
3795 default: 3799 default:
3796 continue; 3800 continue;
3797 } 3801 }
3798 bool is_greedy = true; 3802 bool is_greedy = true;
3799 if (current() == '?') { 3803 if (current() == '?') {
3800 is_greedy = false; 3804 is_greedy = false;
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
4353 start_position, 4357 start_position,
4354 is_expression); 4358 is_expression);
4355 return result; 4359 return result;
4356 } 4360 }
4357 4361
4358 4362
4359 #undef NEW 4363 #undef NEW
4360 4364
4361 4365
4362 } } // namespace v8::internal 4366 } } // namespace v8::internal
OLDNEW
« 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