fix bug for return value when skip_n is passed

This commit is contained in:
Georgii Rylov 2025-03-05 11:47:56 +00:00
parent 811f35bf7d
commit e488345607
2 changed files with 3 additions and 3 deletions

View File

@ -4155,7 +4155,7 @@ aot_copy_callstack_tiny_frame(WASMExecEnv *exec_env, wasm_frame_t *buffer,
frame -= 1;
++count;
}
return count;
return count >= skip_n ? count - skip_n : 0;
}
uint32
@ -4205,7 +4205,7 @@ aot_copy_callstack_standard_frame(WASMExecEnv *exec_env, wasm_frame_t *buffer,
* now it poses a risk due to variable size of the frame
*/
#endif
return count;
return count >= skip_n ? count - skip_n : 0;
}
uint32

View File

@ -4240,7 +4240,7 @@ wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_t *buffer,
cur_frame = cur_frame->prev_frame;
++count;
}
return count;
return count >= skip_n ? count - skip_n : 0;
}
#endif // WAMR_ENABLE_COPY_CALLSTACK