dart-sdk/pkg/vm
Daco Harkes f592a11e51 [vm/ffi] NativeFieldWrapper FfiNative check receivers for nullptr
Changes `FfiNative` instance methods on `NativeFieldWrapperClass`es
that have `Pointer<Void>` conversion to check for `nullptr`.

If the native field has `0`/`nullptr` a `StateError` is thrown:
"Bad state: Native field is nullptr."

This only makes sense if the first native field is used to point to
the C++ object corresponding to the Dart object. As far as we know
all current use cases do so.

TEST=pkg/vm/testcases/transformations/ffi/ffinative.dart.expect
TEST=tests/ffi/vmspecific_ffi_native_test.dart

Closes: https://github.com/dart-lang/sdk/issues/49620
Change-Id: I92f760c33d391476010722358f9713fa4491ab61
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/254200
Reviewed-by: Martin Kustermann <kustermann@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
2022-08-11 17:39:57 +00:00
..
bin [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
lib [vm/ffi] NativeFieldWrapper FfiNative check receivers for nullptr 2022-08-11 17:39:57 +00:00
test [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
testcases/transformations [vm/ffi] NativeFieldWrapper FfiNative check receivers for nullptr 2022-08-11 17:39:57 +00:00
tool [vm/infra] Improve IL testing framework 2021-11-16 12:39:11 +00:00
analysis_options.yaml [pkg/vm] analyze using package:lints 2022-07-07 23:22:49 +00:00
LICENSE Update LICENSE 2021-04-07 10:28:38 +00:00
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.