Skip to content

Commit

Permalink
fix(wasm-c-api): access wasm_frame_vec_t differently if thread mgr is…
Browse files Browse the repository at this point in the history
… enabled
  • Loading branch information
eloparco committed Dec 18, 2023
1 parent 2af3944 commit ba2d4ae
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions core/iwasm/common/wasm_c_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -1981,8 +1981,13 @@ wasm_trap_new_internal(wasm_store_t *store,
}

for (i = 0; i < trap->frames->num_elems; i++) {
#if WASM_ENABLE_THREAD_MGR != 0
((wasm_frame_vec_t *)trap->frames)->data[i]->instance =
frame_instance;
#else
(((wasm_frame_t *)trap->frames->data) + i)->instance =
frame_instance;
#endif
}
}
#else
Expand Down Expand Up @@ -2077,7 +2082,11 @@ wasm_trap_trace(const wasm_trap_t *trap, own wasm_frame_vec_t *out)
}

for (i = 0; i < trap->frames->num_elems; i++) {
#if WASM_ENABLE_THREAD_MGR != 0
wasm_frame_t *frame = ((wasm_frame_vec_t *)trap->frames)->data[i];
#else
wasm_frame_t *frame = ((wasm_frame_t *)trap->frames->data) + i;
#endif
if (!(out->data[i] =
wasm_frame_new(frame->instance, frame->module_offset,
frame->func_index, frame->func_offset))) {
Expand Down

0 comments on commit ba2d4ae

Please sign in to comment.