Skip to content

Commit 16baa33

Browse files
committed
[vm/compiler] Fix build on ARM64 Windows.
Fixes the ARM64 Windows build error introduced by 9b06e26 due to allocating an array of size 0 when the varargs argument to the template is empty. TEST=ci Change-Id: Iccd714de5643da647db8de2a5bea9ef7074610c0 Cq-Include-Trybots: luci.dart.try:vm-win-release-arm64-try,vm-aot-win-release-arm64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398886 Auto-Submit: Tess Strickland <[email protected]> Reviewed-by: Derek Xu <[email protected]>
1 parent a75457d commit 16baa33

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

runtime/vm/compiler/backend/il_test_helper.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,19 @@ TypeParameterPtr GetFunctionTypeParameter(const Function& fun, intptr_t index) {
8181
return param.ptr();
8282
}
8383

84+
ObjectPtr Invoke(const Library& lib, const char* name) {
85+
Thread* thread = Thread::Current();
86+
Dart_Handle api_lib = Api::NewHandle(thread, lib.ptr());
87+
Dart_Handle result;
88+
{
89+
TransitionVMToNative transition(thread);
90+
result =
91+
Dart_Invoke(api_lib, NewString(name), /*argc=*/0, /*argv=*/nullptr);
92+
EXPECT_VALID(result);
93+
}
94+
return Api::UnwrapHandle(result);
95+
}
96+
8497
InstructionsPtr BuildInstructions(
8598
std::function<void(compiler::Assembler* assembler)> fun) {
8699
auto thread = Thread::Current();

runtime/vm/compiler/backend/il_test_helper.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ ClassPtr GetClass(const Library& lib, const char* name);
6565
TypeParameterPtr GetClassTypeParameter(const Class& klass, intptr_t index);
6666
TypeParameterPtr GetFunctionTypeParameter(const Function& fun, intptr_t index);
6767

68+
ObjectPtr Invoke(const Library& lib, const char* name);
69+
6870
InstructionsPtr BuildInstructions(
6971
std::function<void(compiler::Assembler* assembler)> fun);
7072

0 commit comments

Comments
 (0)