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

Side by Side Diff: pkg/compiler/lib/src/ssa/builder.dart

Issue 2910943002: Avoid crash on instantiation of classes with black-listed supertypes. (Closed)
Patch Set: Created 3 years, 6 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 | no next file » | 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 import 'dart:collection'; 5 import 'dart:collection';
6 6
7 import 'package:js_runtime/shared/embedded_names.dart'; 7 import 'package:js_runtime/shared/embedded_names.dart';
8 8
9 import '../closure.dart'; 9 import '../closure.dart';
10 import '../common.dart'; 10 import '../common.dart';
(...skipping 3396 matching lines...) Expand 10 before | Expand all | Expand 10 after
3407 target.redirectionDeferredPrefix, node); 3407 target.redirectionDeferredPrefix, node);
3408 } 3408 }
3409 target = target.immediateRedirectionTarget; 3409 target = target.immediateRedirectionTarget;
3410 } 3410 }
3411 } 3411 }
3412 ResolutionInterfaceType type = elements.getType(node); 3412 ResolutionInterfaceType type = elements.getType(node);
3413 ResolutionInterfaceType expectedType = 3413 ResolutionInterfaceType expectedType =
3414 constructorDeclaration.computeEffectiveTargetType(type); 3414 constructorDeclaration.computeEffectiveTargetType(type);
3415 expectedType = localsHandler.substInContext(expectedType); 3415 expectedType = localsHandler.substInContext(expectedType);
3416 3416
3417 if (compiler.elementHasCompileTimeError(constructor)) { 3417 if (compiler.elementHasCompileTimeError(constructor) ||
3418 compiler.elementHasCompileTimeError(constructor.enclosingClass)) {
3418 // TODO(ahe): Do something like [generateWrongArgumentCountError]. 3419 // TODO(ahe): Do something like [generateWrongArgumentCountError].
3419 stack.add(graph.addConstantNull(closedWorld)); 3420 stack.add(graph.addConstantNull(closedWorld));
3420 return; 3421 return;
3421 } 3422 }
3422 3423
3423 if (checkTypeVariableBounds(node, type)) return; 3424 if (checkTypeVariableBounds(node, type)) return;
3424 3425
3425 // Abstract class instantiation error takes precedence over argument 3426 // Abstract class instantiation error takes precedence over argument
3426 // mismatch. 3427 // mismatch.
3427 ClassElement cls = constructor.enclosingClass; 3428 ClassElement cls = constructor.enclosingClass;
(...skipping 3386 matching lines...) Expand 10 before | Expand all | Expand 10 after
6814 this.oldReturnLocal, 6815 this.oldReturnLocal,
6815 this.oldReturnType, 6816 this.oldReturnType,
6816 this.oldResolvedAst, 6817 this.oldResolvedAst,
6817 this.oldStack, 6818 this.oldStack,
6818 this.oldLocalsHandler, 6819 this.oldLocalsHandler,
6819 this.inTryStatement, 6820 this.inTryStatement,
6820 this.allFunctionsCalledOnce, 6821 this.allFunctionsCalledOnce,
6821 this.oldElementInferenceResults) 6822 this.oldElementInferenceResults)
6822 : super(function); 6823 : super(function);
6823 } 6824 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698