mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
[vm/bytecode] Fix CollectBytecodeFunctionTokenPositions for functions without bytecode
Certain functions (e.g. abstract) don't have bytecode although they are declared in bytecode. As CollectBytecodeFunctionTokenPositions is called for all functions, it should account for absence of bytecode. This fix prevents crashes when certain functions are opened in observatory profiler. Change-Id: I191b01df60a1eff06c8b09fbce80f15fbf409a21 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108965 Reviewed-by: Ryan Macnak <rmacnak@google.com> Reviewed-by: Régis Crelier <regis@google.com> Commit-Queue: Alexander Markov <alexmarkov@google.com>
This commit is contained in:
parent
6c03c1a47c
commit
117c65c901
1 changed files with 3 additions and 1 deletions
|
@ -287,7 +287,9 @@ static void CollectBytecodeFunctionTokenPositions(
|
|||
}
|
||||
}
|
||||
Bytecode& bytecode = Bytecode::Handle(zone, function.bytecode());
|
||||
ASSERT(!bytecode.IsNull());
|
||||
if (bytecode.IsNull()) {
|
||||
return;
|
||||
}
|
||||
if (bytecode.HasSourcePositions() && !function.IsLocalFunction()) {
|
||||
CollectBytecodeTokenPositions(bytecode, zone, token_positions);
|
||||
// Find closure functions in the object pool.
|
||||
|
|
Loading…
Reference in a new issue