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

Unified Diff: runtime/vm/object.cc

Issue 2742733002: [kernel] Don't assume to have source (Closed)
Patch Set: Created 3 years, 9 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 4059f6beefb88fbfd5ef09c20506422ac25e8569..6a443b990f640b3ce9b71ca2537dbb3305093e8e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -9224,9 +9224,9 @@ void Script::GetTokenLocation(TokenPosition token_pos,
// We don't explicitly save this data: Load the source
// and find it from there.
const String& source = String::Handle(zone, Source());
- ASSERT(source.Length() >= offset);
*token_len = 1;
- if (Scanner::IsIdentStartChar(source.CharAt(offset))) {
+ if (offset < source.Length() &&
+ Scanner::IsIdentStartChar(source.CharAt(offset))) {
for (intptr_t i = offset + 1;
i < source.Length() && Scanner::IsIdentChar(source.CharAt(i));
++i) {
« 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