Skip to content

Commit b6daacb

Browse files
author
Georgii Rylov
committed
ignore frames with no function
1 parent 6bfc088 commit b6daacb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/iwasm/interpreter/wasm_runtime.c

+8-2
Original file line numberDiff line numberDiff line change
@@ -4220,10 +4220,16 @@ wasm_interp_iterate_callstack(WASMExecEnv *exec_env,
42204220
WASMCApiFrame record_frame;
42214221
while (cur_frame && (uint8_t *)cur_frame >= bottom
42224222
&& (uint8_t *)cur_frame + sizeof(WASMInterpFrame) <= top_boundary) {
4223+
if (!cur_frame->function) {
4224+
cur_frame = cur_frame->prev_frame;
4225+
continue;
4226+
}
42234227
record_frame.instance = module_inst;
42244228
record_frame.module_offset = 0;
4225-
// It's safe to dereference module_inst->e because "e" is asigned only once in wasm_instantiate
4226-
record_frame.func_index = (uint32)(cur_frame->function - module_inst->e->functions);
4229+
// It's safe to dereference module_inst->e because "e" is asigned only
4230+
// once in wasm_instantiate
4231+
record_frame.func_index =
4232+
(uint32)(cur_frame->function - module_inst->e->functions);
42274233
if (!frame_handler(user_data, &record_frame)) {
42284234
break;
42294235
}

0 commit comments

Comments
 (0)