[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 <dmitryas@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Vyacheslav Egorov <vegorov@google.com>
This commit is contained in:
Dmitry Stefantsov 2018-02-26 14:35:56 +00:00 committed by commit-bot@chromium.org
parent 982fc59531
commit df8deddfa5

View file

@ -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.