[vm/ffi] Add embedder API for resolving asset ids - fix
Stop swallowing error messages.
TEST=Tested in the local engine build in Flutter that uses the new API.
Change-Id: I179366b8d5a251bcb00b5fea722e440c2745a1c7
Cq-Include-Trybots: luci.dart.try:pkg-linux-debug-try,pkg-linux-release-arm64-try,pkg-linux-release-try,pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,vm-ffi-android-debug-arm-try,vm-aot-linux-debug-x64-try,vm-linux-debug-x64-try,vm-win-debug-x64-try,vm-mac-debug-x64-try,vm-mac-debug-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/389740
Auto-Submit: Daco Harkes <dacoharkes@google.com>
Commit-Queue: Martin Kustermann <kustermann@google.com>
Reviewed-by: Martin Kustermann <kustermann@google.com>
diff --git a/runtime/lib/ffi_dynamic_library.cc b/runtime/lib/ffi_dynamic_library.cc
index 8e51bd1..5912f3f 100644
--- a/runtime/lib/ffi_dynamic_library.cc
+++ b/runtime/lib/ffi_dynamic_library.cc
@@ -452,7 +452,7 @@
// Native assets resolution.
void* asset_result = FfiResolveAsset(thread, asset, symbol, error);
- if (asset_result != nullptr) {
+ if (asset_result != nullptr || *error != nullptr) {
return reinterpret_cast<intptr_t>(asset_result);
}