@@ -4197,32 +4197,36 @@ wasm_get_module_inst_mem_consumption(const WASMModuleInstance *module_inst,
41974197 || (WASM_ENABLE_MEMORY_TRACING != 0) */
41984198
41994199#if WASM_ENABLE_DUMP_CALL_STACK != 0
4200- uint32
4201- wasm_interp_iterate_callstack (WASMExecEnv * exec_env , const wasm_frame_callback frame_handler , void * user_data )
4200+ uint32
4201+ wasm_interp_iterate_callstack (WASMExecEnv * exec_env ,
4202+ const wasm_frame_callback frame_handler ,
4203+ void * user_data )
42024204{
4203- /*
4204- * Note for devs: please refrain from such modifications inside of wasm_interp_iterate_callstack
4205- * - any allocations/freeing memory
4206- * - dereferencing any pointers other than: exec_env, exec_env->module_inst,
4207- * exec_env->module_inst->module, pointers between stack's bottom and top_boundary
4208- * For more details check wasm_iterate_callstack in wasm_export.h
4209- */
4210- WASMModuleInstance * module_inst = (WASMModuleInstance * )wasm_exec_env_get_module_inst (exec_env );
4211- WASMInterpFrame * cur_frame = wasm_exec_env_get_cur_frame (exec_env );
4212- uint8 * top_boundary = exec_env -> wasm_stack .top_boundary ;
4213- uint8 * bottom = exec_env -> wasm_stack .bottom ;
4205+ /*
4206+ * Note for devs: please refrain from such modifications inside of
4207+ * wasm_interp_iterate_callstack
4208+ * - any allocations/freeing memory
4209+ * - dereferencing any pointers other than: exec_env, exec_env->module_inst,
4210+ * exec_env->module_inst->module, pointers between stack's bottom and
4211+ * top_boundary For more details check wasm_iterate_callstack in
4212+ * wasm_export.h
4213+ */
4214+ WASMModuleInstance * module_inst =
4215+ (WASMModuleInstance * )wasm_exec_env_get_module_inst (exec_env );
4216+ WASMInterpFrame * cur_frame = wasm_exec_env_get_cur_frame (exec_env );
4217+ uint8 * top_boundary = exec_env -> wasm_stack .top_boundary ;
4218+ uint8 * bottom = exec_env -> wasm_stack .bottom ;
42144219
42154220 WASMCApiFrame record_frame ;
4216- while (cur_frame &&
4217- (uint8_t * )cur_frame >= bottom &&
4218- (uint8_t * )cur_frame + sizeof (WASMInterpFrame ) <= top_boundary ) {
4219- record_frame .instance = module_inst ;
4220- record_frame .module_offset = 0 ;
4221- record_frame .func_index = cur_frame -> func_index ;
4222- if (!frame_handler (user_data , & record_frame )) {
4223- break ;
4224- }
4225- cur_frame = cur_frame -> prev_frame ;
4221+ while (cur_frame && (uint8_t * )cur_frame >= bottom
4222+ && (uint8_t * )cur_frame + sizeof (WASMInterpFrame ) <= top_boundary ) {
4223+ record_frame .instance = module_inst ;
4224+ record_frame .module_offset = 0 ;
4225+ record_frame .func_index = cur_frame -> func_index ;
4226+ if (!frame_handler (user_data , & record_frame )) {
4227+ break ;
4228+ }
4229+ cur_frame = cur_frame -> prev_frame ;
42264230 }
42274231}
42284232
0 commit comments