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

Unified Diff: tools/gn/parser.cc

Issue 2556613002: gn: Fix stale references in Parser::AssignComments(). (Closed)
Patch Set: Created 4 years 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/parser.cc
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc
index 18e1ea12a50960013b0dc14b6b26c69783115a2f..447dfcf5b0fce5466a0aad329594530fe2a25ee9 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -851,8 +851,8 @@ void Parser::AssignComments(ParseNode* file) {
if ((*i)->AsFunctionCall() || (*i)->AsList() || (*i)->AsBlock())
continue;
- const Location& start = (*i)->GetRange().begin();
- const Location& end = (*i)->GetRange().end();
+ Location start = (*i)->GetRange().begin();
+ Location end = (*i)->GetRange().end();
// Don't assign suffix comments to something that starts on an earlier
// line, so that in:
« 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