ea500b450a
It used `ObjectVisitor` to peak into constant objects. The visitor called `AddConstObject` directly while keeping raw pointers around. This is unsafe because `AddConstObject` can cause GC for several different reasons - which would potentially invalidate those raw pointers. I have added `NoSafepointScope` around `VisitPointers` but this does not actually easily reveal the bug because allocations are really sporadic and often require to be running in PRODUCT mode to trigger corresponding code path. Unfortunately we don't have any existing infrastructure to catch "allocation from unsafe place" which works across all build modes and catches even situations where allocation can _potentially_ happen. Fixes https://github.com/flutter/flutter/issues/153358 TEST=manually with a reproduction provided by internal user. R=kustermann@google.com Change-Id: I0c9e14a137b1f8ac749443d80f6904f1e9b20ed7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/382883 Reviewed-by: Martin Kustermann <kustermann@google.com> Commit-Queue: Slava Egorov <vegorov@google.com>