mirror of
https://github.com/dart-lang/sdk
synced 2024-09-19 14:32:49 +00:00
b3525db9a9
joinedLocals is populated with phis and the [thisValue], but [thisValue] could be a phi as well. So the check has to be whether the element of the local is the this element. R=kasperl@google.com Review URL: https://codereview.chromium.org//108293002 git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge/dart@30949 260f80e4-7a28-3924-810f-c04153c831b5
31 lines
663 B
Dart
31 lines
663 B
Dart
// Copyright (c) 2013, 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.
|
|
|
|
// Regression test for dart2js that used to crash on this code.
|
|
|
|
class A {
|
|
operator[]=(index, value) {
|
|
switch (value) {
|
|
case 42: break;
|
|
case 43: break;
|
|
}
|
|
}
|
|
}
|
|
|
|
main() {
|
|
// Make [a] a phi.
|
|
var a;
|
|
if (true) {
|
|
a = new A();
|
|
} else {
|
|
a = new A();
|
|
}
|
|
// `A[]=` being inlined, the compiler was confused when merging the
|
|
// phis after the switch.
|
|
a[0] = 42;
|
|
|
|
// Use [a] to provoke the crash.
|
|
print(a);
|
|
}
|