Files
sdk/runtime
Vyacheslav Egorov 8186104db1 [VM] Return zero from Random_nextState intrinsic instead of GC unsafe garbage.
Random.Random contains the following code:

    return new _Random._withState(state)
      .._nextState()
      .._nextState()
      .._nextState()
      .._nextState();

This code gets compiled into a let cascade by Fasta

    return let final dynamic #t300 = new math::_Random::_withState(state) in
           let final dynamic #t301 = #t300._nextState() in
           let final dynamic #t302 = #t300._nextState() in
           let final dynamic #t303 = #t300._nextState() in
           let final dynamic #t304 = #t300._nextState() in #t300;

This means that _nextState should not return GC unsafe garbage because
its return value will be pushed onto the stack by unoptimizing compiler.

Fixes https://github.com/dart-lang/sdk/issues/31309

R=kustermann@google.com

Bug:
Change-Id: Ib44abfc66ec82c350a3899b054e4b095bbc78ea4
Reviewed-on: https://dart-review.googlesource.com/19569
Commit-Queue: Vyacheslav Egorov <vegorov@google.com>
Reviewed-by: Erik Corry <erikcorry@google.com>
2017-11-10 11:11:57 +00:00
..
2017-11-10 07:59:14 +00:00