Calculate func_index instead of adding an extra field to wasm frame

This commit is contained in:
Georgii Rylov
2025-01-28 11:09:32 +00:00
parent 9ff8052329
commit 6bfc08849a
4 changed files with 4 additions and 10 deletions

View File

@ -4222,7 +4222,8 @@ wasm_interp_iterate_callstack(WASMExecEnv *exec_env,
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary) {
record_frame.instance = module_inst;
record_frame.module_offset = 0;
record_frame.func_index = cur_frame->func_index;
// It's safe to dereference module_inst->e because "e" is asigned only once in wasm_instantiate
record_frame.func_index = (uint32)(cur_frame->function - module_inst->e->functions);
if (!frame_handler(user_data, &record_frame)) {
break;
}