Skip to content

Commit f895110

Browse files
mralephCommit Queue
authored andcommitted
[vm] Fix Flutter Android builds
There seems to be some subtlety around default initialization of std::array, which is not considered a constexpr by the combination of libcxx and clang used in Flutter buildroot. This causes: error: constexpr variable 'kOffsetTo' must be initialized by a constant expression note: non-constexpr constructor 'array' cannot be used in a constant expression Fix this by using explicit initialization instead. TEST=verified manually that Flutter engine builds Change-Id: Iaa26e846a6f19ec236529c87864d0ab4a75f6c4f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/438721 Reviewed-by: Martin Kustermann <[email protected]> Auto-Submit: Slava Egorov <[email protected]> Commit-Queue: Martin Kustermann <[email protected]>
1 parent 7d1998d commit f895110

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

runtime/vm/dart_entry.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -463,8 +463,7 @@ const char* ArgumentsDescriptor::ToCString() const {
463463
intptr_t ArgumentsDescriptor::CacheIndexFor(intptr_t type_args_len,
464464
intptr_t num_arguments) {
465465
static constexpr auto kOffsetTo = []() {
466-
std::array<intptr_t, kMaxTypeArgsForCachedDescriptor + 1> offset;
467-
offset[0] = 0;
466+
std::array<intptr_t, kMaxTypeArgsForCachedDescriptor + 1> offset = {0};
468467
for (intptr_t i = 1; i <= kMaxTypeArgsForCachedDescriptor; i++) {
469468
offset[i] =
470469
offset[i - 1] + (kMaxNumArgumentsForCachedDescriptor[i - 1] + 1);

0 commit comments

Comments
 (0)