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

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

Issue 1243263003: Fix bad assert in constant evaluation. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 | tests/language/indirect_const_null_test.dart » ('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 (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "lib/invocation_mirror.h" 7 #include "lib/invocation_mirror.h"
8 #include "platform/utils.h" 8 #include "platform/utils.h"
9 #include "vm/ast_transformer.h" 9 #include "vm/ast_transformer.h"
10 #include "vm/bootstrap.h" 10 #include "vm/bootstrap.h"
(...skipping 13437 matching lines...) Expand 10 before | Expand all | Expand 10 after
13448 LocalScope* empty_scope = new(Z) LocalScope(NULL, 0, 0); 13448 LocalScope* empty_scope = new(Z) LocalScope(NULL, 0, 0);
13449 SequenceNode* seq = new(Z) SequenceNode(expr->token_pos(), empty_scope); 13449 SequenceNode* seq = new(Z) SequenceNode(expr->token_pos(), empty_scope);
13450 seq->Add(ret); 13450 seq->Add(ret);
13451 13451
13452 Object& result = Object::Handle(Z, Compiler::ExecuteOnce(seq)); 13452 Object& result = Object::Handle(Z, Compiler::ExecuteOnce(seq));
13453 if (result.IsError()) { 13453 if (result.IsError()) {
13454 ReportErrors(Error::Cast(result), 13454 ReportErrors(Error::Cast(result),
13455 script_, expr_pos, 13455 script_, expr_pos,
13456 "error evaluating constant expression"); 13456 "error evaluating constant expression");
13457 } 13457 }
13458 ASSERT(result.IsInstance()); 13458 ASSERT(result.IsInstance() || result.IsNull());
13459 Instance& value = Instance::ZoneHandle(Z); 13459 Instance& value = Instance::ZoneHandle(Z);
13460 value ^= result.raw(); 13460 value ^= result.raw();
13461 value = TryCanonicalize(value, TokenPos()); 13461 value = TryCanonicalize(value, TokenPos());
13462 return value; 13462 return value;
13463 } 13463 }
13464 } 13464 }
13465 13465
13466 13466
13467 void Parser::SkipFunctionLiteral() { 13467 void Parser::SkipFunctionLiteral() {
13468 if (IsIdentifier()) { 13468 if (IsIdentifier()) {
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after
13811 void Parser::SkipQualIdent() { 13811 void Parser::SkipQualIdent() {
13812 ASSERT(IsIdentifier()); 13812 ASSERT(IsIdentifier());
13813 ConsumeToken(); 13813 ConsumeToken();
13814 if (CurrentToken() == Token::kPERIOD) { 13814 if (CurrentToken() == Token::kPERIOD) {
13815 ConsumeToken(); // Consume the kPERIOD token. 13815 ConsumeToken(); // Consume the kPERIOD token.
13816 ExpectIdentifier("identifier expected after '.'"); 13816 ExpectIdentifier("identifier expected after '.'");
13817 } 13817 }
13818 } 13818 }
13819 13819
13820 } // namespace dart 13820 } // namespace dart
OLDNEW
« no previous file with comments | « no previous file | tests/language/indirect_const_null_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698