From a7f87440be49df85cd3400a5ee61a2fa05bc1d4a Mon Sep 17 00:00:00 2001 From: "podivilov@google.com" Date: Wed, 26 Sep 2012 12:18:19 +0000 Subject: [PATCH] Fix invalid location in inline super constructor. R=ahe@google.com BUG=5184 Review URL: https://codereview.chromium.org//10991035 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@12903 260f80e4-7a28-3924-810f-c04153c831b5 --- lib/compiler/implementation/ssa/builder.dart | 6 ++- .../source_mapping_crash_source.dart | 54 +++++++++++++++++++ .../source_mapping_crash_test.dart | 15 ++++++ 3 files changed, 73 insertions(+), 2 deletions(-) create mode 100644 tests/compiler/dart2js_extra/source_mapping_crash_source.dart create mode 100644 tests/compiler/dart2js_extra/source_mapping_crash_test.dart diff --git a/lib/compiler/implementation/ssa/builder.dart b/lib/compiler/implementation/ssa/builder.dart index 6750f6de210..4f4ee426912 100644 --- a/lib/compiler/implementation/ssa/builder.dart +++ b/lib/compiler/implementation/ssa/builder.dart @@ -1113,7 +1113,9 @@ class SsaBuilder extends ResolvedVisitor implements Visitor { element: constructor); } + sourceElementStack.add(constructor.enclosingElement); buildFieldInitializers(constructor.enclosingElement, fieldValues); + sourceElementStack.removeLast(); int index = 0; FunctionSignature params = constructor.computeSignature(compiler); @@ -2297,8 +2299,8 @@ class SsaBuilder extends ResolvedVisitor implements Visitor { typeInfo = pop(); } if (type.element.isTypeVariable()) { - // TODO(karlklose): We currently answer true to any is check - // involving a type variable -- both is T and is !T -- until + // TODO(karlklose): We currently answer true to any is check + // involving a type variable -- both is T and is !T -- until // we have a proper implementation of reified generics. stack.add(graph.addConstantBool(true, constantSystem)); } else { diff --git a/tests/compiler/dart2js_extra/source_mapping_crash_source.dart b/tests/compiler/dart2js_extra/source_mapping_crash_source.dart new file mode 100644 index 00000000000..825360f25db --- /dev/null +++ b/tests/compiler/dart2js_extra/source_mapping_crash_source.dart @@ -0,0 +1,54 @@ +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +/******************************************************************************* + * Long comment to make positions in this file exceed those in + * 'source_mapping_crash_test.dart'. + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + ******************************************************************************* + */ +class Super { + final sb = new StringBuffer(); + Super(var y); +} diff --git a/tests/compiler/dart2js_extra/source_mapping_crash_test.dart b/tests/compiler/dart2js_extra/source_mapping_crash_test.dart new file mode 100644 index 00000000000..b5cc2e0f63d --- /dev/null +++ b/tests/compiler/dart2js_extra/source_mapping_crash_test.dart @@ -0,0 +1,15 @@ +// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file +// for details. All rights reserved. Use of this source code is governed by a +// BSD-style license that can be found in the LICENSE file. + +#source('source_mapping_crash_source.dart'); + +class Sub extends Super { + Sub(var x) : super(x.y); +} + +class X { var y; } + +main() { + new Sub(new X()); +}