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

Unified Diff: runtime/vm/parser.cc

Issue 22460008: Fix attempt to find metadata of a library with no metadata. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/parser.cc
diff --git a/runtime/vm/parser.cc b/runtime/vm/parser.cc
index d541aa4ce45c9718b83d9a04fb2fd4c6c2fbc5c3..10601210232485cf707819ca479d47609a9d26ce 100644
--- a/runtime/vm/parser.cc
+++ b/runtime/vm/parser.cc
@@ -4743,8 +4743,8 @@ void Parser::ParseLibraryDefinition() {
// declaration that follows the library definitions. Therefore, we
// need to remember the position of the last token that was
// successfully consumed.
- intptr_t metadata_pos = TokenPos();
- SkipMetadata();
+ intptr_t rewind_pos = TokenPos();
+ intptr_t metadata_pos = SkipMetadata();
if (CurrentToken() == Token::kLIBRARY) {
if (is_patch_source()) {
ErrorMsg("patch cannot override library name");
@@ -4753,14 +4753,14 @@ void Parser::ParseLibraryDefinition() {
if (metadata_pos >= 0) {
library_.AddLibraryMetadata(current_class(), metadata_pos);
}
- metadata_pos = TokenPos();
- SkipMetadata();
+ rewind_pos = TokenPos();
+ metadata_pos = SkipMetadata();
}
while ((CurrentToken() == Token::kIMPORT) ||
(CurrentToken() == Token::kEXPORT)) {
ParseLibraryImportExport();
- metadata_pos = TokenPos();
- SkipMetadata();
+ rewind_pos = TokenPos();
+ metadata_pos = SkipMetadata();
}
// Core lib has not been explicitly imported, so we implicitly
// import it here.
@@ -4773,10 +4773,10 @@ void Parser::ParseLibraryDefinition() {
}
while (CurrentToken() == Token::kPART) {
ParseLibraryPart();
- metadata_pos = TokenPos();
- SkipMetadata();
+ rewind_pos = TokenPos();
+ metadata_pos = SkipMetadata();
}
- SetPosition(metadata_pos);
+ SetPosition(rewind_pos);
}
« no previous file with comments | « no previous file | tests/lib/lib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698