dart-sdk/pkg/vm
Daco Harkes e364fda064 Reland "[cfe/ffi] Improve FFI call mismatched types compile errors"
This is a reland of commit 206fdf148c

Original change's description:
> [cfe/ffi] Improve FFI call mismatched types compile errors
>
> This CL fixes two issues.
>
> 1. `FfiNative`s now check the Dart and native type for compatiblity.
> 2. Both `FfiNative`, `asFunction`, and `lookupFunction` check the type
>    correspondence between native and Dart type with a subtype check of
>    the expected Dart type and the provided Dart type. For functions,
>    any return type is a subtype of a void type. This is fine for Dart,
>    but not for native calls. This CL manually checks the return type
>    for void.
>
> This CL does not fix the inconsistency between `asFunction` and
> `FfiNative` with regard to allowing more strict return types than
> `Object` for `Handle`s
> Issue: https://github.com/dart-lang/sdk/issues/49518
>
> Analyzer fixes in follow up CL.
>
> TEST=tests/ffi/vmspecific_static_checks_ffinative_test.dart
>
> Closes: https://github.com/dart-lang/sdk/issues/49471
> Change-Id: Ibc7bd6a1a0db59cc5fa5d755d76999fd7e9a06a4
> Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-mac-release-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252601
> Reviewed-by: Martin Kustermann <kustermann@google.com>
> Commit-Queue: Daco Harkes <dacoharkes@google.com>

TEST=tests/ffi/vmspecific_static_checks_ffinative_test.dart

Change-Id: Ic1efba45ae8ff2585fc67fdf63c653ce090d0337
Cq-Include-Trybots: luci.dart.try:analyzer-linux-release-try,analyzer-mac-release-try,vm-ffi-android-debug-arm-try,vm-ffi-android-debug-arm64c-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/252663
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
2022-08-01 16:09:03 +00:00
..
bin [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
lib Reland "[cfe/ffi] Improve FFI call mismatched types compile errors" 2022-08-01 16:09:03 +00:00
test [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
testcases/transformations [vm] New implementation of sync* based on suspend/resume stubs 2022-06-27 18:19:12 +00:00
tool
analysis_options.yaml [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
LICENSE
OWNERS [infra] Add OWNERS to the Dart SDK 2022-02-14 14:06:34 +00:00
pubspec.yaml [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
README.md

This package hosts VM specific Dart code and helper scripts.