[vm/ffi] Fix callback void returns

The void case was removed in
https://dart-review.googlesource.com/c/sdk/+/353101/68/runtime/vm/compiler/frontend/kernel_to_il.cc#b5594

The void case is handled in `FfiConvertPrimitiveToNative`, but the
null check should not happen for void.

It doesn't seem to reproduce for me locally, but the bug report and
workaround are clear about what error is thrown.
TEST=No idea why it's not reproducing.

Bug: https://github.com/flutter/flutter/issues/149017
Change-Id: Ifbffa501af904a0d2268d0e4e19a9145e6c694cc
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/368341
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Tess Strickland <sstrickl@google.com>
This commit is contained in:
Daco Harkes 2024-05-29 09:58:02 +00:00 committed by Commit Queue
parent b9216c5804
commit a8dcef9173

View file

@ -5683,7 +5683,8 @@ FlowGraph* FlowGraphBuilder::BuildGraphOfSyncFfiCallback(
ICData::kNoRebind);
}
if (!marshaller.IsHandleCType(compiler::ffi::kResultIndex)) {
if (!marshaller.IsVoid(compiler::ffi::kResultIndex) &&
!marshaller.IsHandleCType(compiler::ffi::kResultIndex)) {
body += CheckNullOptimized(
String::ZoneHandle(Z, Symbols::New(H.thread(), "return_value")),
CheckNullInstr::kArgumentError);