Skip to content

Commit e488345

Browse files
author
Georgii Rylov
committed
fix bug for return value when skip_n is passed
1 parent 811f35b commit e488345

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core/iwasm/aot/aot_runtime.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,7 +4155,7 @@ aot_copy_callstack_tiny_frame(WASMExecEnv *exec_env, wasm_frame_t *buffer,
41554155
frame -= 1;
41564156
++count;
41574157
}
4158-
return count;
4158+
return count >= skip_n ? count - skip_n : 0;
41594159
}
41604160

41614161
uint32
@@ -4205,7 +4205,7 @@ aot_copy_callstack_standard_frame(WASMExecEnv *exec_env, wasm_frame_t *buffer,
42054205
* now it poses a risk due to variable size of the frame
42064206
*/
42074207
#endif
4208-
return count;
4208+
return count >= skip_n ? count - skip_n : 0;
42094209
}
42104210

42114211
uint32

core/iwasm/interpreter/wasm_runtime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,7 @@ wasm_interp_copy_callstack(WASMExecEnv *exec_env, wasm_frame_t *buffer,
42404240
cur_frame = cur_frame->prev_frame;
42414241
++count;
42424242
}
4243-
return count;
4243+
return count >= skip_n ? count - skip_n : 0;
42444244
}
42454245
#endif // WAMR_ENABLE_COPY_CALLSTACK
42464246

0 commit comments

Comments
 (0)