mirror of
https://github.com/dart-lang/sdk
synced 2024-11-02 12:24:24 +00:00
f21b7cafbc
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> |
||
---|---|---|
.. | ||
aliasing_test.dart | ||
all_positive.dart | ||
allocator_test.dart | ||
analysis_options.yaml | ||
callback_tests_utils.dart | ||
calloc_test.dart | ||
coordinate.dart | ||
data_not_asan_test.dart | ||
data_test.dart | ||
dylib_isolates_test.dart | ||
dylib_utils.dart | ||
expando_test.dart | ||
extension_methods_test.dart | ||
external_typed_data_test.dart | ||
ffi_2.status | ||
ffi_test_helpers.dart | ||
function_callbacks_many_test.dart | ||
function_callbacks_structs_by_value_generated_test.dart | ||
function_callbacks_structs_by_value_test.dart | ||
function_callbacks_test.dart | ||
function_callbacks_very_many_test.dart | ||
function_structs_by_value_generated_test.dart | ||
function_structs_test.dart | ||
function_test.dart | ||
function_very_many_test.dart | ||
hardfp_test.dart | ||
has_symbol_test.dart | ||
inline_array_multi_dimensional_test.dart | ||
inline_array_test.dart | ||
native_effect_test.dart | ||
negative_function_test.dart | ||
null_regress_39068_test.dart | ||
null_test.dart | ||
prepare_flutter_bundle.dart | ||
regress_37254_test.dart | ||
regress_39044_test.dart | ||
regress_39063_test.dart | ||
regress_39885_test.dart | ||
regress_40537_test.dart | ||
regress_43016_test.dart | ||
regress_43693_test.dart | ||
regress_44985_test.dart | ||
regress_44986_test.dart | ||
regress_45189_test.dart | ||
regress_45198_test.dart | ||
regress_45507_test.dart | ||
regress_45988_test.dart | ||
regress_46004_test.dart | ||
regress_46085_test.dart | ||
regress_46127_test.dart | ||
regress_flutter79441_test.dart | ||
regress_jump_to_frame_test.dart | ||
sizeof_test.dart | ||
snapshot_test.dart | ||
stacktrace_regress_37910_test.dart | ||
structs_nested_test.dart | ||
structs_packed_test.dart | ||
structs_test.dart | ||
unaligned_test.dart | ||
variance_function_test.dart | ||
very_large_struct.dart | ||
vmspecific_dynamic_library_test.dart | ||
vmspecific_enable_ffi_test.dart | ||
vmspecific_function_callbacks_exit_test.dart | ||
vmspecific_function_callbacks_negative_test.dart | ||
vmspecific_function_callbacks_test.dart | ||
vmspecific_function_gc_test.dart | ||
vmspecific_function_test.dart | ||
vmspecific_handle_dynamically_linked_test.dart | ||
vmspecific_handle_test.dart | ||
vmspecific_highmem_32bit_test.dart | ||
vmspecific_leaf_call_test.dart | ||
vmspecific_null_test.dart | ||
vmspecific_object_gc_test.dart | ||
vmspecific_regress_37100_test.dart | ||
vmspecific_regress_37511_callbacks_test.dart | ||
vmspecific_regress_37511_test.dart | ||
vmspecific_regress_37780_test.dart | ||
vmspecific_regress_38993_test.dart | ||
vmspecific_send_port_id_test.dart | ||
vmspecific_static_checks_test.dart | ||
vmspecific_variance_function_checks_test.dart |