From df8deddfa50eb035be68eca56ae7a713e956c5bc Mon Sep 17 00:00:00 2001 From: Dmitry Stefantsov Date: Mon, 26 Feb 2018 14:35:56 +0000 Subject: [PATCH] [vm] Skip functions in source reports if their token pos is unknown Change-Id: I2f953ee5745dd7193a77098d0e83d5ac247f5886 Reviewed-on: https://dart-review.googlesource.com/43720 Commit-Queue: Dmitry Stefantsov Reviewed-by: Jens Johansen Reviewed-by: Vyacheslav Egorov --- runtime/vm/source_report.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runtime/vm/source_report.cc b/runtime/vm/source_report.cc index e6e8ac791a1..33afde7f24b 100644 --- a/runtime/vm/source_report.cc +++ b/runtime/vm/source_report.cc @@ -65,6 +65,13 @@ bool SourceReport::IsReportRequested(ReportKind report_kind) { } bool SourceReport::ShouldSkipFunction(const Function& func) { + // TODO(32315): Verify that the check is still needed after the issue is + // resolved. + if (!func.token_pos().IsReal() || !func.end_token_pos().IsReal()) { + // At least one of the token positions is not known. + return true; + } + if (script_ != NULL && !script_->IsNull()) { if (func.script() != script_->raw()) { // The function is from the wrong script.