Skip to content

Commit

Permalink
Lookup pinvoke_names in wasm_dl_load first
Browse files Browse the repository at this point in the history
  • Loading branch information
jeromelaban committed May 4, 2019
1 parent 4c034a4 commit ca9892c
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions sdks/wasm/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,18 +164,15 @@ mono_wasm_setenv (const char *name, const char *value)
static void*
wasm_dl_load (const char *name, int flags, char **err, void *user_data)
{
#if WASM_SUPPORTS_DLOPEN
void* handle = dlopen (name, flags);

if (handle) {
return handle;
}
#endif

for (int i = 0; i < sizeof (pinvoke_tables) / sizeof (void*); ++i) {
if (!strcmp (name, pinvoke_names [i]))
return pinvoke_tables [i];
}

#if WASM_SUPPORTS_DLOPEN
return dlopen(name, flags);
#endif

return NULL;
}

Expand Down

0 comments on commit ca9892c

Please sign in to comment.