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

Side by Side Diff: src/parser.cc

Issue 18612: Fix an unsound use of a string shape in the parser. (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 unified diff | Download patch | Annotate | Revision Log
« 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 TemporaryScope temp_scope(this); 1112 TemporaryScope temp_scope(this);
1113 ZoneListWrapper<Statement> body(16); 1113 ZoneListWrapper<Statement> body(16);
1114 bool ok = true; 1114 bool ok = true;
1115 ParseSourceElements(&body, Token::EOS, &ok); 1115 ParseSourceElements(&body, Token::EOS, &ok);
1116 if (ok) { 1116 if (ok) {
1117 result = NEW(FunctionLiteral(no_name, top_scope_, 1117 result = NEW(FunctionLiteral(no_name, top_scope_,
1118 body.elements(), 1118 body.elements(),
1119 temp_scope.materialized_literal_count(), 1119 temp_scope.materialized_literal_count(),
1120 temp_scope.contains_array_literal(), 1120 temp_scope.contains_array_literal(),
1121 temp_scope.expected_property_count(), 1121 temp_scope.expected_property_count(),
1122 0, 0, source->length(shape), false)); 1122 0, 0, source->length(), false));
1123 } else if (scanner().stack_overflow()) { 1123 } else if (scanner().stack_overflow()) {
1124 Top::StackOverflow(); 1124 Top::StackOverflow();
1125 } 1125 }
1126 } 1126 }
1127 1127
1128 // Make sure the target stack is empty. 1128 // Make sure the target stack is empty.
1129 ASSERT(target_stack_ == NULL); 1129 ASSERT(target_stack_ == NULL);
1130 1130
1131 // If there was a syntax error we have to get rid of the AST 1131 // If there was a syntax error we have to get rid of the AST
1132 // and it is not safe to do so before the scope has been deleted. 1132 // and it is not safe to do so before the scope has been deleted.
(...skipping 3216 matching lines...) Expand 10 before | Expand all | Expand 10 after
4349 start_position, 4349 start_position,
4350 is_expression); 4350 is_expression);
4351 return result; 4351 return result;
4352 } 4352 }
4353 4353
4354 4354
4355 #undef NEW 4355 #undef NEW
4356 4356
4357 4357
4358 } } // namespace v8::internal 4358 } } // 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