Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a few dyld related crashes #93

Merged
merged 3 commits into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion cli/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,12 @@ main(int argc, char *const *argv)
goto fail;
}
#if defined(TOYWASM_ENABLE_WASI_THREADS)
if (state->wasi_threads != NULL) {
if (state->wasi_threads != NULL
#if defined(TOYWASM_ENABLE_DYLD)
/* if dyld is enabled, make thread_spawn fail. */
&& !opts->enable_dyld
#endif
) {
const struct repl_module_state_u *mod_u =
&state->modules[state->nmodules - 1];
const struct repl_module_state *mod = &mod_u->u.repl;
Expand Down
4 changes: 1 addition & 3 deletions libdyld/dyld.c
Original file line number Diff line number Diff line change
Expand Up @@ -670,9 +670,7 @@ dyld_load_object_from_file(struct dyld *d, const struct name *name,
goto fail;
}
obj->name = name;
#if defined(TOYWASM_ENABLE_TRACING)
const struct name *objname = dyld_object_name(obj);
#endif
ret = map_file(filename, (void *)&obj->bin, &obj->binsz);
if (ret != 0) {
goto fail;
Expand All @@ -689,7 +687,7 @@ dyld_load_object_from_file(struct dyld *d, const struct name *name,
}
load_context_clear(&lctx);
if (obj->module->dylink == NULL) {
xlog_error("module %.*s doesn't have dylink.0", CSTR(name));
xlog_error("module %.*s doesn't have dylink.0", CSTR(objname));
ret = EINVAL;
goto fail;
}
Expand Down