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

Side by Side Diff: src/parser.cc

Issue 192773002: Fix assertion in RegExp parser to correctly expect stack overflow. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-350865.js » ('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 4972 matching lines...) Expand 10 before | Expand all | Expand 10 after
4983 Reset(start); 4983 Reset(start);
4984 return false; 4984 return false;
4985 } 4985 }
4986 *min_out = min; 4986 *min_out = min;
4987 *max_out = max; 4987 *max_out = max;
4988 return true; 4988 return true;
4989 } 4989 }
4990 4990
4991 4991
4992 uc32 RegExpParser::ParseOctalLiteral() { 4992 uc32 RegExpParser::ParseOctalLiteral() {
4993 ASSERT('0' <= current() && current() <= '7'); 4993 ASSERT(('0' <= current() && current() <= '7') || current() == kEndMarker);
4994 // For compatibility with some other browsers (not all), we parse 4994 // For compatibility with some other browsers (not all), we parse
4995 // up to three octal digits with a value below 256. 4995 // up to three octal digits with a value below 256.
4996 uc32 value = current() - '0'; 4996 uc32 value = current() - '0';
4997 Advance(); 4997 Advance();
4998 if ('0' <= current() && current() <= '7') { 4998 if ('0' <= current() && current() <= '7') {
4999 value = value * 8 + current() - '0'; 4999 value = value * 8 + current() - '0';
5000 Advance(); 5000 Advance();
5001 if (value < 32 && '0' <= current() && current() <= '7') { 5001 if (value < 32 && '0' <= current() && current() <= '7') {
5002 value = value * 8 + current() - '0'; 5002 value = value * 8 + current() - '0';
5003 Advance(); 5003 Advance();
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
5349 ASSERT(info()->isolate()->has_pending_exception()); 5349 ASSERT(info()->isolate()->has_pending_exception());
5350 } else { 5350 } else {
5351 result = ParseProgram(); 5351 result = ParseProgram();
5352 } 5352 }
5353 } 5353 }
5354 info()->SetFunction(result); 5354 info()->SetFunction(result);
5355 return (result != NULL); 5355 return (result != NULL);
5356 } 5356 }
5357 5357
5358 } } // namespace v8::internal 5358 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/regress/regress-350865.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698