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

Unified Diff: runtime/vm/object.cc

Issue 1810663002: Fail gracefully in Script::GetLine under precompilation like Script::GetSnippet. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 7b847749a3bfe505facb5a68c5ae516c3a46cc04..30d8116671500b45af3a312f4d0d862a4e0a6700 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -8807,6 +8807,10 @@ void Script::TokenRangeAtLine(intptr_t line_number,
RawString* Script::GetLine(intptr_t line_number, Heap::Space space) const {
const String& src = String::Handle(Source());
+ if (src.IsNull()) {
+ ASSERT(Dart::IsRunningPrecompiledCode());
+ return Symbols::OptimizedOut().raw();
+ }
intptr_t relative_line_number = line_number - line_offset();
intptr_t current_line = 1;
intptr_t line_start_idx = -1;
« 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