gn: Fix stale references in Parser::AssignComments().

ParseNode::GetRange() returns a LocationRange (value, not reference),
while LocationRange::begin() returns a const Location&. Initializing a
local const Location& variable with that doesn't extend the lifetime of
the temporary.

Review-Url: https://codereview.chromium.org/2556613002
Cr-Original-Commit-Position: refs/heads/master@{#436637}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: d177088c55ef63ab7f28c34bdd124faf01adb389
diff --git a/tools/gn/parser.cc b/tools/gn/parser.cc
index 18e1ea1..447dfcf 100644
--- a/tools/gn/parser.cc
+++ b/tools/gn/parser.cc
@@ -851,8 +851,8 @@
     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: