mirror of
https://github.com/dart-lang/sdk
synced 2024-09-16 00:09:49 +00:00
[pkg/vm_snapshot_analysis] Don't assume Code objects have an owner.
For regular stubs, the owner will be null. Issue: https://github.com/flutter/flutter/issues/130009 Change-Id: I8c85e3130128af79c596f381869d61631221cf9e Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-linux-release-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/312660 Reviewed-by: Slava Egorov <vegorov@google.com> Commit-Queue: Tess Strickland <sstrickl@google.com>
This commit is contained in:
parent
82577191ec
commit
1133598168
|
@ -1,5 +1,10 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## 0.7.5
|
||||||
|
|
||||||
|
- Fix for flutter/flutter#130009 where an attempt to lookup the owner info
|
||||||
|
node for type testing stubs would cause a null check error.
|
||||||
|
|
||||||
## 0.7.4
|
## 0.7.4
|
||||||
|
|
||||||
- Fix for flutter/flutter#128402 where an attempt to lookup the owner info
|
- Fix for flutter/flutter#128402 where an attempt to lookup the owner info
|
||||||
|
|
|
@ -413,16 +413,16 @@ class _ProgramInfoBuilder {
|
||||||
ProgramInfoNode? createInfoNodeFor(Node node) {
|
ProgramInfoNode? createInfoNodeFor(Node node) {
|
||||||
switch (node.type) {
|
switch (node.type) {
|
||||||
case 'Code':
|
case 'Code':
|
||||||
final owner = node['owner_']!;
|
final owner = node['owner_']; // Stubs may have no owner.
|
||||||
if (owner.type == 'Function') {
|
if (owner?.type == 'Function') {
|
||||||
// For normal functions we just attribute Code object and all
|
// For normal functions we just attribute Code object and all
|
||||||
// objects dominated by it to the function itself.
|
// objects dominated by it to the function itself.
|
||||||
return getInfoNodeFor(owner)!;
|
return getInfoNodeFor(owner!)!;
|
||||||
}
|
}
|
||||||
// For all stub types, we create a dummy functionNode that is going to
|
// For all stub types, we create a dummy functionNode that is going to
|
||||||
// own all objects dominated by it.
|
// own all objects dominated by it.
|
||||||
final ownerNode =
|
final ownerNode =
|
||||||
owner.type == 'Class' ? getInfoNodeFor(owner)! : program.stubs;
|
owner?.type == 'Class' ? getInfoNodeFor(owner!)! : program.stubs;
|
||||||
return makeInfoNode(node.index,
|
return makeInfoNode(node.index,
|
||||||
name: node.name, parent: ownerNode, type: NodeType.functionNode);
|
name: node.name, parent: ownerNode, type: NodeType.functionNode);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: vm_snapshot_analysis
|
name: vm_snapshot_analysis
|
||||||
version: 0.7.4
|
version: 0.7.5
|
||||||
description: Utilities for analysing AOT snapshot size.
|
description: Utilities for analysing AOT snapshot size.
|
||||||
repository: https://github.com/dart-lang/sdk/tree/main/pkg/vm_snapshot_analysis
|
repository: https://github.com/dart-lang/sdk/tree/main/pkg/vm_snapshot_analysis
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue