mirror of
https://github.com/dart-lang/sdk
synced 2024-09-05 08:24:39 +00:00
![]() Before: `NoSuchMethodError: The method 'FfiTrampoline' was called on null.` After: `Invalid argument(s): argument value for ':ffi_param2' is null`. Makes the ArgumentNullError RTE lookup the name of the argument in the code source map when reporting a null argument. Makes the FFI call arguments and FFI callbacks use kArgumentError instead of the default kNoSuchMethod so that we target this RTE instead. This changes the Error type from `NoSuchMethodError` to `ArgumentError`. Because `Error`s should not be caught [1], this is fine. Since FFI trampolines are created from type arguments, the arguments do not have names. The arguments are assigned names programmatically. See the related bug. Also, this CL cleans up the SourcePosition of the `CheckNullOptimized`, it was never passed. [1] https://dart.dev/guides/language/effective-dart/usage#dont-explicitly-catch-error-or-types-that-implement-it TEST=tests/ffi/function_test.dart Closes: https://github.com/dart-lang/sdk/issues/47094 Bug: https://github.com/dart-lang/sdk/issues/36780 Change-Id: I15e7de4d026e034bde0eda3ba7fe3785f0da5057 Cq-Include-Trybots: luci.dart.try:vm-precomp-ffi-qemu-linux-release-arm-try,vm-ffi-android-debug-arm-try,vm-kernel-precomp-dwarf-linux-product-x64-try,vm-kernel-precomp-linux-debug-x64-try,app-kernel-linux-debug-x64-try,vm-kernel-reload-rollback-linux-debug-x64-try,vm-kernel-reload-linux-debug-x64-try,vm-ffi-android-debug-arm64-try,vm-kernel-nnbd-mac-debug-x64-try,vm-kernel-precomp-nnbd-linux-debug-x64-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/212462 Commit-Queue: Daco Harkes <dacoharkes@google.com> Reviewed-by: Clement Skau <cskau@google.com> Reviewed-by: Tess Strickland <sstrickl@google.com> |
||
---|---|---|
.. | ||
co19 | ||
co19_2 | ||
corelib | ||
corelib_2 | ||
dartdevc | ||
dartdevc_2 | ||
ffi | ||
ffi_2 | ||
language | ||
language_2 | ||
lib | ||
lib_2 | ||
modular | ||
standalone | ||
standalone_2 | ||
web | ||
web_2 | ||
legacy_status_dart2js.csv | ||
README.md |
This directory contains tests of the language and core library implementations. For more information, see https://github.com/dart-lang/sdk/wiki/Testing.