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

Side by Side Diff: runtime/vm/parser.cc

Issue 9110001: Fix potential problem with expression evaluation. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/parser.h" 5 #include "vm/parser.h"
6 6
7 #include "vm/bigint_operations.h" 7 #include "vm/bigint_operations.h"
8 #include "vm/class_finalizer.h" 8 #include "vm/class_finalizer.h"
9 #include "vm/compiler.h" 9 #include "vm/compiler.h"
10 #include "vm/compiler_stats.h" 10 #include "vm/compiler_stats.h"
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 ConsumeToken(); 1843 ConsumeToken();
1844 const intptr_t expr_pos = token_index_; 1844 const intptr_t expr_pos = token_index_;
1845 AstNode* expr = ParseExpr(kAllowConst); 1845 AstNode* expr = ParseExpr(kAllowConst);
1846 ASSERT(expr != NULL); 1846 ASSERT(expr != NULL);
1847 current_block_->statements->Add(new ReturnNode(expr_pos, expr)); 1847 current_block_->statements->Add(new ReturnNode(expr_pos, expr));
1848 } else if (IsLiteral("native")) { 1848 } else if (IsLiteral("native")) {
1849 ParseNativeFunctionBlock(&params, func); 1849 ParseNativeFunctionBlock(&params, func);
1850 } else { 1850 } else {
1851 UnexpectedToken(); 1851 UnexpectedToken();
1852 } 1852 }
1853 current_block_->statements->Add(CloseBlock()); 1853 SequenceNode* body = CloseBlock();
1854 SequenceNode* statements = CloseBlock(); 1854 current_block_->statements->Add(body);
1855 return statements; 1855 return CloseBlock();
1856 } 1856 }
1857 1857
1858 1858
1859 void Parser::SkipIf(Token::Kind token) { 1859 void Parser::SkipIf(Token::Kind token) {
1860 if (CurrentToken() == token) { 1860 if (CurrentToken() == token) {
1861 ConsumeToken(); 1861 ConsumeToken();
1862 } 1862 }
1863 } 1863 }
1864 1864
1865 1865
(...skipping 5827 matching lines...) Expand 10 before | Expand all | Expand 10 after
7693 } 7693 }
7694 7694
7695 7695
7696 void Parser::SkipNestedExpr() { 7696 void Parser::SkipNestedExpr() {
7697 const bool saved_mode = SetAllowFunctionLiterals(true); 7697 const bool saved_mode = SetAllowFunctionLiterals(true);
7698 SkipExpr(); 7698 SkipExpr();
7699 SetAllowFunctionLiterals(saved_mode); 7699 SetAllowFunctionLiterals(saved_mode);
7700 } 7700 }
7701 7701
7702 } // namespace dart 7702 } // namespace dart
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