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

Side by Side Diff: pkg/analyzer/lib/src/summary/link.dart

Issue 1989943002: Fix linker's handling of malformed function references. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Revert unnecessary method rename Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 /** 5 /**
6 * This library is capable of producing linked summaries from unlinked 6 * This library is capable of producing linked summaries from unlinked
7 * ones (or prelinked ones). It functions by building a miniature 7 * ones (or prelinked ones). It functions by building a miniature
8 * element model to represent the contents of the summaries, and then 8 * element model to represent the contents of the summaries, and then
9 * scanning the element model to gather linked information and adding 9 * scanning the element model to gather linked information and adding
10 * it to the summary data structures. 10 * it to the summary data structures.
(...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after
995 : unlinkedReference.name; 995 : unlinkedReference.name;
996 int containingReference = unlinkedReference == null 996 int containingReference = unlinkedReference == null
997 ? linkedReference.containingReference 997 ? linkedReference.containingReference
998 : unlinkedReference.prefixReference; 998 : unlinkedReference.prefixReference;
999 if (containingReference != 0 && 999 if (containingReference != 0 &&
1000 _linkedUnit.references[containingReference].kind != 1000 _linkedUnit.references[containingReference].kind !=
1001 ReferenceKind.prefix) { 1001 ReferenceKind.prefix) {
1002 if (linkedReference.kind == ReferenceKind.function) { 1002 if (linkedReference.kind == ReferenceKind.function) {
1003 // Local function 1003 // Local function
1004 _references[index] = _resolveRef(containingReference) 1004 _references[index] = _resolveRef(containingReference)
1005 .getLocalFunction(linkedReference.localIndex); 1005 .getLocalFunction(linkedReference.localIndex) ??
1006 UndefinedElementForLink.instance;
1006 } else { 1007 } else {
1007 _references[index] = 1008 _references[index] =
1008 _resolveRef(containingReference).getContainedName(name); 1009 _resolveRef(containingReference).getContainedName(name);
1009 } 1010 }
1010 } else if (linkedReference.dependency == 0) { 1011 } else if (linkedReference.dependency == 0) {
1011 if (name == 'void') { 1012 if (name == 'void') {
1012 _references[index] = enclosingElement._linker.voidElement; 1013 _references[index] = enclosingElement._linker.voidElement;
1013 } else if (name == '*bottom*') { 1014 } else if (name == '*bottom*') {
1014 _references[index] = enclosingElement._linker.bottomElement; 1015 _references[index] = enclosingElement._linker.bottomElement;
1015 } else if (name == 'dynamic') { 1016 } else if (name == 'dynamic') {
(...skipping 3619 matching lines...) Expand 10 before | Expand all | Expand 10 after
4635 * there are no type parameters in scope. 4636 * there are no type parameters in scope.
4636 */ 4637 */
4637 TypeParameterizedElementMixin get _typeParameterContext; 4638 TypeParameterizedElementMixin get _typeParameterContext;
4638 4639
4639 @override 4640 @override
4640 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation); 4641 noSuchMethod(Invocation invocation) => super.noSuchMethod(invocation);
4641 4642
4642 @override 4643 @override
4643 String toString() => '$enclosingElement.$name'; 4644 String toString() => '$enclosingElement.$name';
4644 } 4645 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/src/summary/linker_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698