Skip to content

VM bug with deferred loading and await #28678

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fsc8000 opened this issue Feb 8, 2017 · 0 comments
Closed

VM bug with deferred loading and await #28678

fsc8000 opened this issue Feb 8, 2017 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

Comments

@fsc8000
Copy link
Contributor

fsc8000 commented Feb 8, 2017

Repro:

import 'dart:async';
import 'mylib.dart'  deferred as D;
class A {
  m() => print("here");
}
f(a, b) => new Future.microtask(() {});
class R {
  var _i;
  Future test_deferred() async {
    var a = new A();
    await D.loadLibrary();
    await f(D.Clazz, D.v);
    a.m();
  }
}
main() async {
  await new R().test_deferred();
}

mylib.dart

var v;
class Clazz { }

Expected output:

here

Actual output:

Unhandled exception:
NoSuchMethodError: The method 'm' was called on null.
Receiver: null
Tried calling: m()
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:44)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:47)
...
...
@fsc8000 fsc8000 added the area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. label Feb 8, 2017
@fsc8000 fsc8000 self-assigned this Feb 8, 2017
@fsc8000 fsc8000 closed this as completed in 67a93da Feb 8, 2017
whesse pushed a commit that referenced this issue Feb 21, 2017
When referring to constants via a deferred prefix in an await expression
the transformation must make sure that the generated code before and after
the deferred load agree on the number of captured variables. (i.e. the number
of await-temp variables introduced by the await-transformer is the same)

This CL uses a temporary in the case of compile-time constants, because before
the deferred load, a reference lib.C is translated into a static getter which
also requires a temporary.

Fixes #28678

[email protected]

Review-Url: https://codereview.chromium.org/2683973002 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
Projects
None yet
Development

No branches or pull requests

1 participant